Example: For each volume in its collection, a library requires the catalog number and any information concerning translations, other volumes in a series, additional copies on file, and so on. The catalog file consists of variable-length records, and except for the catalog number, the required information is contained in the variable-length portion of each record. (The record layout is given in the following figure Sample Record Layout.)
To include only the relevant fields on the input records and to generate this list, the following is coded.
The following figure shows the input record after INREC processing.
Explanation: When selecting fields on variable-length records, you must observe these two restrictions: (1) The position of the RDW cannot be affected; and (2) at least one byte from the fixed-length portion of the record, in addition to the RDW, must be specified. On the above INREC statement, the first 14 bytes of each record – the 4-byte RDW and the fixed-length Catalog Number field – are retained unchanged. The next field – which contains more information, as required – is indicated only by position (98) since it is of variable-length. This causes the entire variable-length portion of the record (beginning with byte 98) to be included after the initial 14 bytes of the post-INREC record. MFX automatically adjusts the RDW to reflect the new record length.