Reputation: 307
Need a SORT JCL to write down records from input file, which have written '7' on 5th position.
input file:
AABL5ZZZZ
AAQL7AAAA
ZZWA76AAA
AAXC01AAA
OUTPUT
AAQL7AAAA
ZZWA76AAA
Upvotes: 0
Views: 3844
Reputation: 11921
If you don't want the records sorted you could use something like
//*******************************************
//SORT EXEC PGM=SORT
//*******************************************
//SORTIN DD DSN=MY.INPUT.FILE,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,1,CH,EQ,C'7')
END
/*
For sorting just change the SORT FIELDS=
statement.
P.S.: The above JCL is for fixed record-length files. If you use variable record-length you have to take care of two points:
So the SYSIN would look like
OPTION VLSHRT
SORT FIELDS=COPY
INCLUDE COND=(9,1,CH,EQ,C'7')
END
Upvotes: 4