z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 4

z/OS DFSORT Application Programming Guide
SC23-6878-00

  OPTION COPY,Y2PAST=1985
  INREC FIELDS=(SEQNUM,4,BI,
                8,5,ZD,TO=PD,
                31,2,PD,TO=FI,LENGTH=2,
                15,6,Y2TP,
                25,3,CHANGE=(1,C'L92',X'01',C'M72',X'02',C'J42',X'03'),
                NOMATCH=(X'FF'))

This example illustrates how a sequence number can be generated, how values in one numeric or date format can be converted to another format, and how a lookup table can be used.

The reformatted input records will look as follows:
Position
Contents
1-4
A binary sequence number that starts at 1 and increments by 1.
5–7
A PD field containing the converted ZD field from input positions 8 through 12.
8–9
An FI field containing the converted PD field from input positions 31 through 32.
10–14
A P'yyyymmdd' date field containing the C'yymmdd' date field from input positions 15-20 transformed according to the specified century window of 1985-2084.
15
A BI field containing X'01', X'02', X'03' or X'FF' as determined by using a lookup table for the input field in positions 25-27.

The SORT statement can now refer to the "sort" field in the reformatted input records. The OUTREC statement is used to restore the records to their original format.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014