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.
I will just describe those:
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,
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:
FINDREP: Reformat each record by doing various types of find and replace operations. Example: