Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
The INREC control statement allows you to reformat the input records before they are processed; that is, to define which parts of the input record are to be included in the reformatted input record, in what order they are to appear, and how they are to be aligned.
You do this by defining one or more fields from the input record. The reformatted input record consists of only those fields, in the order in which you have specified them, and aligned on the boundaries or in the columns you have indicated.
You can find complete details of DFSORT's INREC statement online at:
As a practical example, say you have groups of records each with a header that has a key, and detail and trailer records that don't have a key, but you want to sort the groups of records by the key. You could use DFSORT's WHEN=GROUP function in INREC to propagate the key from the first record of the group to the other records of the group and then SORT on the key in every record. You can do this with INREC because it's processed before SORT. You could NOT do this with OUTREC because it's processed after SORT.