This utility provides an easy way of creating a delimited file. It exists in two formats. The first permits text fields of up to 10 characters to be used. The second permits use of text fields of up to 50 characters to be used.
Information is passed to a formatting program in an array. The formatting program returns a single field of 255 characters (2000 in IS9040E).
Routine | Include Member |
---|---|
IS9040B | LIB9040B |
IS9040C | LIB9040C |
IS9040E | LIB9040E |
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 returned. It contains the delimited file for PC use. The variable is 255 bytes. If your expected return field is more than 255 bytes, you must break the process into multiple pieces. For IS9040E, this field is 2000 characters in length.
The second variable is a 1 character field. Programmatically assign to it the delimiter you want used in the output file.
The third variable is an array with 100 occurrences. For IS9040A, each occurence is 10 characters in length, 50 characters for IS9040C and 250 occurrences for IS9040E. Place data in each array element that you wish to have in delimited format in your output file.
The fourth variable differs between the two routines. For IS9040B, this is a numeric array. Each array element represents the length the IS9040A routine found and used for the corresponding element in the third variable. For IS9040C and IS9040e, it is the total length of the returned, delimited, text field (first variable).
The routines are used as follows:
For IS9040B: CALL IS9040B USING HLINK
For IS9040C: CALL IS9040C USING HLINK
For IS9040E: CALL IS9040E USING HLINK
where HLINK is the variable containing the four variables described above. HLINK is the name used in the INCLUDE members.
If you are dealing with numerics, you must do your own pre-formatting. Most PC programs will want
For an alphanumeric field, you should also do your own pre-formatting. Most PC programs will want
When the routine finds a blank field, it will assume that no additional values follow. If you need a blank field, enter it as "".
Normally it is fine to output a fixed-length file. The lengths that are returned can be used if you need to output a file with variable-length records.
... ... ... HNAME W 030 A HSTREET W 030 A HSTATE W 002 A HZIP W 005 A OUTREC W 255 A %LIB9040C ... ... ... MOVE SPACES TO HLINK HL2 = ';' HL3 (1) = HNAME HL3 (2) = HSTREET HL3 (3) = HCITY HL3 (4) = HSTATE HL3 (5) = HZIP CALL IS9040C USING HLINK MOVE HL1 HL4 TO OUTREC 255 ... ... ...
Last Modified: Tuesday, 22-Oct-2002 09:08:59 CDT
©2000 All Rights Reserved