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


Example 1

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

 * Method 1
 SORT FROM(MASTER) TO(PRINT,TAPE,DISK) USING(ABCD)
 * Method 2
 SORT FROM(MASTER) TO(DISK,TAPE,PRINT) USING(ABCD) SERIAL
This example shows two different methods for creating multiple sorted output data sets. Assume that the ABCDCNTL data set contains:
  SORT FIELDS=(15,20,CH,A,1,5,PD,D)

Method 1 requires one call to DFSORT, one pass over the input data set, and allows the output data sets to be specified in any order. The SORT operator sorts all records from the MASTER data set to the PRINT (SYSOUT), TAPE, and DISK data sets, using the SORT statement in the ABCDCNTL data set and OUTFIL processing.

Method 2 requires three calls to DFSORT, three passes over the input data set, and imposes the restriction that the SYSOUT data set must not be the first TO data set. The SORT operator sorts all records from the MASTER data set to the DISK data set, using the SORT statement in the ABCDCNTL data set, and then copies the resulting DISK data set to the TAPE and PRINT (SYSOUT) data sets. Because the first TO data set is processed three times (written, read, read), placing the DISK data set first is more efficient than placing the TAPE data set first. PRINT must not be the first in the TO list because a SYSOUT data set cannot be read.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014