This is a sample JCL to split the input dataset into multiple output files. The OUTFIL operands INCLUDE, OMIT and SAVE can be used to select the records to be included in each output data set.

SAVE can be used to select the records that are not selected for any other subset, eliminating the need to specify complex conditions.
Here’s an example of OUTFIL subsets:
//SYSIN DD *
OUTFIL INCLUDE=(8,6,CH,EQ,C'ACCTNG'),FNAMES=GP1
OUTFIL INCLUDE=(8,6,CH,EQ,C'DVPMNT'),FNAMES=GP2
OUTFIL INCLUDE=(8,6,SS,EQ,C'ADMIN ,RESRCH'),FNAMES=GP3
OUTFIL SAVE,FNAMES=NOT123 /*
Explanation
- Records with ACCTNG in positions 8-13 are written to the GP1 data set.
- Records with DVPMNT in positions 8-13 are written to the GP2 data set.
- Records with ADMIN or RESRCH in positions 8-13 are written to the GP3
data set. - Records without ACCTNG, DVPMNT, ADMIN or RESRCH in positions 8-13 are written to the NOT123
Related Posts
You must be logged in to post a comment.