Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 13 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how you can reformat records containing variable position/length fields, such as comma separated values. The 80-byte input records might look like this:
Note that each record has five variable fields, each enclosed in quotes and separated by a comma. The fields do not start and end in the same position in every record and they have different lengths in different records. The 42-byte output records should look like this:
The first fixed-length
output field corresponds to the first variable input field. The second
fixed-length output field corresponds to the total of the third and
fourth variable input fields. The third fixed-length output field
corresponds to the fifth variable input field.In order to reformat the input records for output, we use PARSE and BUILD to create the fixed parsed fields we need from the variable position/length fields; the quotes around each value are removed. %00 is used for the first input field. % is used to ignore the second input field. %03 and %04 are used for the third and fourth input fields which are added together using SFF format. %05 is used for the fifth input field. |
Copyright IBM Corporation 1990, 2014
|