I would like to write an output file containing a certain sort criteria and would like the remaining records that do not fit the criteria to be written to another dataset. How should that be written?

Custom Search
I would like to write an output file containing a certain sort criteria and would like the remaining records that do not fit the criteria to be written to another dataset. How should that be written?
Click the +1 button below to share it with your friends and colleagues
Try something like:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(1,1,CH,EQ,C'A') or whatever
OUTFIL FNAMES=OUT2,SAVE
/*