Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
Hi Chinni,
OUTREC Describes how records are to be reformatted after they are sorted, copied or merged.
BUILD: 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 records and the order in which they appear. You can delete, rearrange and insert fields and constants.
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.
I would like to know whatever BUILD does can be done using OUTREC right? Are there any specific things alone can be done using these three features? I mean unique facility of these three.
Lets say if we want to reform an output record this can be done using OUTREC, BUILD and OVERLAY?? Hope you understood what I ask for.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
INREC, OUTREC and OUTFIL are DFSORT control statements that you can use to reformat records.
BUILD and OVERLAY are parameters of the INREC, OUTREC and OUTFIL statements. The INREC statement can be used to reformat records before sorting, merging or copying. The OUTREC statement can be used to reformat records after sorting, merging or copying. OUTFIL statements can be used to reformat records for different output files and a lot more.
For the INREC and OUTREC statements, the BUILD parameter is an alias of the FIELDS parameter. For the OUTFIL statement, the BUILD parameter is an alias of the OUTREC parameter.
BUILD reformats a record item by item - you must specify each item to be included in the output record. OVERLAY overlays specific positions - you only need to specify the items to be overlaid.
So the BUILD and OVERLAY parameters can be used consistently with INREC, OUTREC or OUTFIL (as well as with IFTHEN clauses), whereas the FIELDS parameter can only be used with INREC/OUTREC, and the OUTREC parameter can only be used with OUTFIL.
Quote:
I would like to know whatever BUILD does can be done using OUTREC right? Are there any specific things alone can be done using these three features? I mean unique facility of these three.
Lets say if we want to reform an output record this can be done using OUTREC, BUILD and OVERLAY?? Hope you understood what I ask for.
It depends on whether you mean the OUTREC statement or the OUTREC parameter. The BUILD parameter is equivalent to the OUTREC parameter for OUTFIL. But the BUILD parameter can also be used on the INREC and OUTREC statements whereas the OUTREC parameter can't be used on those statements.
If you're asking if you can reformat records using BUILD or OVERLAY, the answer is yes, but BUILD requires you to specify every item whereas OVERLAY only requires you to specify the items to be overlaid.
For an overview of DFSORT's reformatting functions including BUILD, OVERLAY and IFTHEN, see:
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: