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


Example 2

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

* Method 1
COPY FROM(IN) TO(DEPT1) USING(DPT1)
COPY FROM(IN) TO(DEPT2) USING(DPT2)
COPY FROM(IN) TO(DEPT3) USING(DPT3)
* Method 2
COPY FROM(IN) USING(ALL3)
This example shows two different methods for creating subsets of an input data set. Assume that:
  • The DPT1CNTL data set contains:
     INCLUDE COND=(5,3,CH,EQ,C'D01')
  • The DPT2CNTL data set contains:
     INCLUDE COND=(5,3,CH,EQ,C'D02')
  • The DPT3CNTL data set contains:
     INCLUDE COND=(5,3,CH,EQ,C'D03')
  • The ALL3CNTL data set contains:
     OUTFIL FNAMES=DEPT1,INCLUDE=(5,3,CH,EQ,C'D01')
     OUTFIL FNAMES=DEPT2,INCLUDE=(5,3,CH,EQ,C'D02')
     OUTFIL FNAMES=DEPT3,INCLUDE=(5,3,CH,EQ,C'D03')
Method 1 requires three calls to DFSORT and three passes over the input data set:
  • The first COPY operator copies the records from the IN data set that contain D01 in positions 5-7 to the DEPT1 data set.
  • The second COPY operator copies the records from the IN data set that contain D02 in positions 5-7 to the DEPT2 data set.
  • The third COPY operator copies the records from the IN data set that contain D03 in positions 5-7 to the DEPT3 data set.

Method 2 accomplishes the same result as method 1, but because it uses OUTFIL statements instead of TO operands, requires only one call to DFSORT and one pass over the input data set.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014