SORT JCL to Split data using OUTFIL
SORT JCL to Split data using OUTFIL
The following sort card will sort split the input file into two files.
First file will have records which have 'AB' at 266th position and
second file will have records which have 'AC' at 266th position.
SORT FIELDS=COPYOUTFIL FILES=01,INCLUDE=(266,2,CH,EQ,C'AB')OUTFIL FILES=02,INCLUDE=(266,2,CH,EQ,C'AC')
Example JCL is provided below
; ; ; ;
//SETP001 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//REPORT1 DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=USERID.ABC.INPFILE
//SORTOF01 DD DSN=USERID.ABC.OUTFIL1,
// DISP=(,CATLG),
// SPACE=(TRK,(30,10),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
//SORTOF02 DD DSN=USERID.ABC.OUTFIL2,
// DISP=(,CATLG),
// SPACE=(TRK,(30,10),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
//SORTWK01 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SORTWK02 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SORTWK03 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(266,2,CH,EQ,C'AB')
OUTFIL FILES=02,
INCLUDE=(266,2,CH,EQ,C'AC')
/*
//*
Comments
Anonymous
Fri, 03/23/2012 - 12:21
Permalink
what is the format of the outfil statement if I want all records
Hi,
what is the format of the sort outfil statement if I want all records of the input file put into it??
thanks
Wanda
DikDude
Fri, 04/06/2012 - 16:57
Permalink
Don't use an OUTFIL
Don't use an OUTFIL statement.
SORT FIELDS=COPY with nothing additional will copy the entire file.
Anonymous
Thu, 12/06/2012 - 15:04
Permalink
How to split into 3 files based on input counts
I have sort in file
1111
2222
3333
4444
5555
6666
Then how can I use sort utility to gives me output in 3 dataset (based on Count of records it splits the data in 3 files). And also count can vary in sort in file.
Thanks!!
DikDude
Fri, 12/07/2012 - 20:48
Permalink
3 dataset split
You need to post which records you want in each of the 3 output files.