PC Delimited File Decipher Utility

Many processes require that a file be sent to and from persons who use them on a PC. Nost PC-based files require files in a delimited format rather than the mainframe columnar format.

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.

Easytrieve Plus

Each routine uses an Easytrieve Plus include member to define the needed working-storage variables.

RoutineInclude Member
IS9040ALIB9040B
IS9040DLIB9040D

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.

Programming Notes

All variables returned from the routine are in text format. If you want any special formatting done, it must be done after invoking the routine.

Easytrieve Plus Example

    ...
    ...
    ...
     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)
    ...
    ...
    ...