I want to sort the file and want to create 2 output file depending on certain conditions. I am able to do this.
Now, I want that each o/p file should have only one record. that means I want to stop processing after both the o/p files have one records each.
I know SKIPREC and STOPAFT but they are applicable to input file and not to output files. Please help.
Now I want only one record in o/p files SORTOUT1 and SORTOUT2.
I changed sort fileds=copy with below code
OPTION COPY,STOPAFT=1
The result is not coming properly. I think STOPAFT=1 is reading only one record of the input file and dont have effect with the no. of records of the o/p file.
Hope this will clarify my requirement and question.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Shriram Jogdand,
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), DFSORT now has OUTFIL ACCEPT=n which lets you control as to how many records you want in the OUTFIL file.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00
10 A
10 B
10 C
20 A
20 B
20 C
30
40
//SORTOUT1 DD SYSOUT=*
//SORTOUT2 DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(1,2,SS,EQ,C'10,20')
OPTION COPY
OUTFIL FNAMES=SORTOUT1,ACCEPT=1,INCLUDE=(1,2,CH,EQ,C'10')
OUTFIL FNAMES=SORTOUT2,ACCEPT=1,INCLUDE=(1,2,CH,EQ,C'20')
//*
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see: