You can read my previous installment if you miss it. DFSORT is a very good concept for record manipulation. As a mainframe resource, if you have command on DFSORT you will get many job opportunities. Read this book to get more exposure.
INREC and OUTREC in DFSORT
In the join keys recently I used, in my work, Inrec, Outrec and Overlay in a sort card.
DFSFORT: INREC and OVERLAY in JCL
I will just describe those:
INREC IFTHEN(WHEN=(21,20,EQ,0),OVERLAY=(21:140,20))
Inrec works just like if you want to replace a part of your input record to your data. When is the condition Overlay is the actual value to be replaced similarly,
DFSORT: OUTREC and OVERLAY in JCL
OUTREC IFTHEN(WHEN=(25,20,GE,0),OVERLAY=(25:20C' '))
The overlay will be occurred in the final output record. It is as I said, it replaces the data. Normally it will be given with Join Keys or during the sort.
Other usages with Inrec and Outrec:(SOurce IBM)
BUILD or FIELDS: Reformat each record by specifying all of its items one by one. Build gives you complete control over the items you want in your reformatted OUTREC records and the order in which they appear. You can delete, rearrange and insert fields and constants. Example:
OUTREC BUILD=(1,20,C'ABC',26:5C'*', 15,3,PD,EDIT=(TTT.TT),21,30,80:X)
OVERLAY: Reformat each record by specifying just the items that overlay specific columns. Overlay lets you change specific existing columns without affecting the entire record. Example:
OUTREC OVERLAY=(45:45,8,TRAN=LTOU)
FINDREP: Reformat each record by doing various types of find and replace operations. Example:
OUTREC FINDREP=(IN=C'Mr.',OUT=C'Mister')
Also read
Related
One thought
Comments are closed.