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


OUTREC method

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

 INCLUDE COND=(5,1,GE,C'M'),FORMAT=CH
 OUTREC FIELDS=(10,3,20,8,33,11,5,1)
 SORT FIELDS=(20,8,CH,A,10,3,FI,A)
 SUM FIELDS=(38,4,BI)

These examples illustrate how a fixed-length input data set is sorted and reformatted for output. Unnecessary fields are eliminated from the output records using INREC or OUTREC. The SORTIN LRECL is 80.

Records are also included or excluded by means of the INCLUDE statement, and summed by means of the SUM statement.

The reformatted input records are fixed length with a record size of 23 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 23. The reformatted records look as follows after INREC or OUTREC processing:
Position
Contents
1-3
Input positions 10 through 12
4-11
Input positions 20 through 27
12-22
Input positions 33 through 43
23
Input position 5

Identical results are achieved with INREC or OUTREC. However, use of OUTREC makes it easier to code the SORT and SUM statements. In either case, the INCLUDE COND parameters must refer to the fields of the original input records. However, with INREC, the SUM and SORT FIELDS parameters must refer to the fields of the reformatted input records, while with OUTREC, the SUM and SORT FIELDS parameters must refer to the fields of the original input records.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014