Ideas: How to Split the File Using OUTFIL

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.


Norway Culture

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

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.