This utility provides an easy way of understanding a PC-based delimited file in a mainframe program. It exists in two formats. The first permits text fields of up to 10 characters to be interpreted. The second permits use of text fields of up to 50 characters to be interpreted.
Information is passed to an unformatting program in a variable. The unformatting program returns an array of up to 100 fields passed in the PC-based file.
Routine | Include Member |
---|---|
IS9040A | LIB9040B |
IS9040D | LIB9040D |
When using either routine, you should first blank out the parameter area being used. this will insure that the output area is clean.
The first variable is the text field from the PC-based file. It contains the delimited file record. The variable is 255 bytes.
The second variable is a 1 character field. Programmatically assign to it the delimiter used in the PC-based input file.
The third variable is an array with 100 occurrences. For IS9040A, each occurence is 10 characters in length, 50 characters for IS9040D. The deciphered (unstrung) data will be placed in this array.
The fourth variable is value lengths. This is a numeric array. Each array element represents the length the routine found for the corresponding element in the third variable.
The routines are used as follows:
For IS9040A: CALL IS9040A USING HLINK
For IS9040D: CALL IS9040D USING HLINK
where HLINK is the variable containing the four variables described above. HLINK is the name used in the INCLUDE member.
... ... ... HNAME W 030 A HSTREET W 030 A HSTATE W 002 A HZIP W 005 A %LIB9040D FILE INFILE INREC 001 255 A ... ... ... MOVE SPACES TO HLINK MOVE INREC IFILE:RECORD-LENGTH TO HL1 255 HL2 = ';' CALL IS9040D USING HLINK HNAME = HL3 (1) HSTREET = HL3 (2) HCITY = HL3 (3) HSTATE = HL3 (4) HZIP = HL3 (5) ... ... ...