IWTEST01 Sample Program

In this section:

The IWTEST01 sample program generates a new random balance every time it is called and a new comment. Otherwise, it is an echo program, which is used to test the fill, justification, truncation, defaults, cursor.


Top of page

x
Sample Program Location and Directory Structure

The IWTEST01 sample program and related program files are located in the following directory:

<iway_home>\etc\samples\ims\iwtest01

where:

<iway_home>

Is the location on your system where iWay Service Manager is installed.

The following subdirectories are included for the IWTEST01 sample program:



x
Document Subdirectory

The document subdirectory contains an XML input document for the adapter.



x
Reference: IWTEST01_IN.XML Input Document

The following is the structure of the IWTEST01_IN.XML input document:

<?xml version="1.0" encoding="UTF-8" ?>
<IMS>
<Transaction location="IMS/Transactions/IWTEST01">
<IW01MI>
<Segment>
<TCODE>IWTEST01 </TCODE>
<WHATEVER>WHATEVER  </WHATEVER>
<BCODE>11</BCODE>
<NAME>MUSS</NAME>
</Segment>
</IW01MI>
</Transaction>
</IMS>


x
MFS Subdirectory

The mfs subdirectory contains the MFS XML files, which describe the mapping of the input document to the data sent to IMS and the mapping of the incoming data from IMS to the output document. The adapter takes the input document, formats it according to the input MFS XML file, and sends it to IMS. It then takes the data IMS sends back, formats it according to the output MFS XML file, and passes the result to the caller. These descriptions are derived from the real IMS MFS definitions.



x
Reference: IW01MI.XML Input Document

The following is the structure of the IW01MI.XML input document:

<?xml version="1.0" encoding="UTF-8" ?>
<MSG name="IW01MI" opt="1" type="INPUT" next="IW01MO">
	<SEG>
		<MFLD name="TCODE" 
         Length="9"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill=" "
         InputMFSDocumentUsage="Required"
      />
		 <MFLD name="WHATEVER"
         Length="10"
         iwaySuppress="no"
         iwayFieldType="alpha"
         attribute="no"
         fill=" "
      />
		<MFLD name="PFKEYIND"
         Length="1"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill=" "
      />
		<MFLD name="CSRPOS"
         Length="4"
         iwayFieldType="cursor"
         default="7,2"
         InputMFSDocumentUsage="Forbidden"
      />
		<MFLD name="BCODE"
         Length="12"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="right"
         attribute="yes"
         fill="0"
         InputMFSDocumentUsage="Optional"
      />
		<MFLD name="USERID"
         Length="8"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill="U"
      />
		<MFLD name="LTERM"
         Length="8"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill="P"
      />
		<MFLD name="NAME"
         Length="38"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="yes"
         fill="S"
      />		
		<MFLD name="ACCT"
         Length="12"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="yes"
         fill="#"
      />		
		<MFLD name="BALANCE"
         Length="12"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="right"
        attribute="no"
         fill="0"
      />		
		<MFLD name="COMM"
         Length="42"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="yes"
         fill=" "
      />		
	</SEG>
</MSG>


x
Reference: IW01MO.XML Output Document

The following is the structure of the IW01MO.XML output document:

<?xml version="1.0" encoding="UTF-8" ?>
<MSG name="IW01MO" opt="1" type="OUTPUT" next="IW01MI">
	<SEG>
		<MFLD name="TCODE" 
         Length="9"
         iwaySuppress="no"
         iwayFieldType="alpha"
         attribute="no"
         fill=" "
      />
		 <MFLD name="WHATEVER"
         Length="10"
         iwaySuppress="no"
         iwayFieldType="alpha"
         attribute="no"
         fill=" "
      />
		<MFLD name="PFKEYIND"
         Length="1"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill=" "
      />
		<MFLD name="CSRPOS"
         Length="4"
         iwayFieldType="cursor"
        OutputMFSDocumentUsage="IfNotDefault"
         default="1,2"
       />
		<MFLD name="BCODE"
         Length="12"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="right"
         attribute="yes"
         fill="0"
      />
 		<MFLD name="USERID"
         Length="8"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill=" "
      />
		<MFLD name="LTERM"
         Length="8"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill=" "
         OutputMFSDocumentUsage="Never"
      />
		<MFLD name="NAME"
         Length="38"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="yes"
         fill="Z"
      />		
		<MFLD name="ACCT"
         Length="12"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="yes"
         fill=" "
      />		
		<MFLD name="BALANCE"
         Length="12"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="right"
        attribute="no"
         fill="0"
      />		
		<MFLD name="COMM"
         Length="42"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="yes"
         fill=" "
      />	
               <!-- To test mismatch error 
		<MFLD name="MISMATCH"
         Length="42"
         iwaySuppress="no"
         iwayFieldType="alpha"
         justification="left"
         attribute="no"
         fill=" "
      />		-->
	</SEG>
</MSG>


x
SRC Subdirectory

The src subdirectory contains the following IMS components that are required to run the IWTEST01 sample program:


iWay Software