Page 1 of 1

sort & copy to 2 o/p files in one pass?

PostPosted: Tue Oct 13, 2009 7:46 pm
by c0r5a38
DFSORT Z/OS R1.10....

I have a two step job with each step executing DFSORT using the same SORTIN file in each with different SORTOUT files.
The SYSIN cards for the first DFSORT step is as follows:
INREC FIELDS=(1,800)
SORT FIELDS=(1,800,CH,A)
SUM FIELDS=NONE
OUTFIL FNAMES=SORTOUT,
IFTHEN=(WHEN=(422,1,CH,EQ,C'Y'),
BUILD=(1,148,C'REG VIOL ',149,21,179,622))

The SYSIN cards for the second DFSORT is as follows:
SORT FIELDS=COPY
OUTFIL INCLUDE=(841,1,CH,EQ,C'Y'),FNAMES=SORTOUT,
OUTREC=(801,300)

How can this job be merged into a single DFSORT pass? Thanks.

Re: sort & copy to 2 o/p files in one pass?

PostPosted: Tue Oct 13, 2009 9:02 pm
by Frank Yaeger
You can't do a SORT and COPY in a single DFSORT pass (that is, by reading the input data only once). If you wanted both output files sorted the same way, or both output files just copied, then you could do it in one pass.

You could, of course, do it in one step with ICETOOL, but it would still take two passes since you're doing a SORT for one output file and a COPY for the other.