Selecting Fields from Variable-Length Records - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
Last updated
2024-08-27
Published on
2024-08-27T08:14:56.318001

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.)

Figure 1. Sample Record Layout

To include only the relevant fields on the input records and to generate this list, the following is coded.

Figure 2. JCL and Required Control Statements

The following figure shows the input record after INREC processing.

Figure 3. Form of Post-INREC Record

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.