|
Using OUREC in SORT JCL
|
OUTREC adds, deletes, or reformats fields after the
records are sorted or merged.
INREC adds, deletes, or reformats fields before the
records are sorted or merged. so that performance will
be improved
SORT OUTREC Example JCL.
Let us assume input file has following data and structure
INPUT FILE |
MOHANK 23423423434534344 KIRAN
MOHANK 13342345345345345 RAJEEV
ARAMES 34535345325354324 SURESH
SURESH 23447385385933987 PULI
RAMESH 67575789769876785 MADHU
KRISHN 50830948530859340 OIIED
KRISHN 30495849572938495 MADHU
SURESH 98347385385933987 PULI
|
|
SORT OUTREC Example JCL.
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(7:2,5,20:10,3)
/*
//* copyright www.mainframegurukul.com
OUTPUT FILE |
OHANK 342
OHANK 334
RAMES 453
URESH 834
AMESH 757
RISHN 083
RISHN 049
URESH 834
|
EXPLANATION
1. SORT FIELDS=COPY
It is for copy records to output file
2. OUTREC FIELDS=(7:2,5,20:10,3) (for formatting)
Here we have two formattings,
1. 7:2,5 - Data at 2nd position of input file with length 5
copied to 7th position of output file
2. 20:10,3 - Data at 10th position of input file with length 3
copied to 20th position of output file
|
|