Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 30 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how you can split an input file with a header, and a trailer containing a count and total for the input data records, into two output files each of which has the header and a trailer with accurate count and total for the included data records. The input data set has RECFM=FB and LRECL=80 with these input records:
The first record is a header record with a date. The records with D in position 1 are data records; they have key1 or key2 in positions 3-6 and an amount field in positions 10-13. The trailer record is identified by a 'T' in position 1. Positions 6-9 contain a count (0007) of the data records, and positions 14-19 contain a total (001903) for the amount fields in the data records. In addition, there are other static fields in the trailer record that must not be changed. Note that IFTRAIL with HD=YES does not process the header or trailer records as data records, so they are not included in the count or total. The first OUTFIL statement writes the header record, data records with key1, and trailer record, in the OUT1 data set. The IFTRAIL operand is used to identify the trailer (TRLID), indicate the first record is a header (HD=YES), and update the count and total in the trailer (TRLUPD) to reflect the input data records included in this output data set. OUT1 will have these records:
The second OUTFIL statement writes the header record, data records with key2, and trailer record, in the OUT2 data set. The IFTRAIL operand is used to identify the trailer (TRLID), indicate the first record is a header (HD=YES), and update the count and total in the trailer (TRLUPD) to reflect the input data records included in this output data set. Note that IFTRAIL with HD=YES does not process the header or trailer records as data records, so they are not included in the count or total. OUT2 will have these records:
|
Copyright IBM Corporation 1990, 2014
|