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


Example 12

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

 OPTION COPY
   OUTFIL OUTREC=(SEQNUM,4,BI,Z,8,5,ZD,TO=PD,Z,
          31,2,PD,TO=FI,LENGTH=2),Z,
          16,3,ZD,ADD,+1,TO=FI,LENGTH=2,Z,
          (16,3,ZD,MAX,31,2,PD),MUL,+2,TO=ZD,LENGTH=4)

This example illustrates how a sequence number can be generated, how values in one numeric format can be converted to another numeric format, and how arithmetic expressions involving fields and decimal constants can be used.

The input data set has an LRECL of 50 and the SORTOUT data set will have an LRECL of 19.

The OUTFIL statement creates output records with the following fields:
  • A binary sequence number in bytes 1-4 that starts at 1 and increments by 1.
  • X'00' in byte 5.
  • A PD field in bytes 6-8 containing the converted ZD field from input bytes 8-12
  • X'00' in position 9.
  • An FI field in bytes 10-11 containing the converted PD field from input bytes 31-32.
  • X'00' in position 12.
  • An FI field in bytes 13-14 containing the converted result of the ZD field from input bytes 16-18 incremented by 1.
  • X'00' in position 15.
  • A ZD field in bytes 16-19 containing the converted result of the maximum of the ZD field from input bytes 16-18 and the PD field from input bytes 31-32, multiplied by 2.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014