Adjusting your view to allow for header information

When you are using a copybook or template to format your records, there are times when the information in your records is displaced because your copybook or template defines its fields as beginning to the right or left of the actual data in the record. For example, your records may include header information, which is not defined in the copybook record structure, or your copybook may include a definition for some header information which is not in the actual record. (PL/I copybooks are sometimes coded with a 4 byte RDW field that File Manager strips from the record, as it isn't normally considered part of the data.) To map your template to your records without changing the originating copybook, you can specify an offset value, which changes the template's field starting positions to the left or right.

The offset value is an integer between -32760 and 32760, which is applied to one or more Level 01 fields in the template. The starting position of each field within the Level 01 record structure is increased or decreased by this value. A positive offset moves the fields to the right and some fields might be mapped beyond the length of the record. Data that falls beyond the length of the record is not represented. You cannot edit a field where the data you supply would fall beyond the physical end of the record (whether the record is of fixed or variable length). A negative offset moves the fields to the left and all fields with a resultant zero or negative start location are removed from the display.

All required fields must have a positive start location. Required fields are fields such as OCCURS DEPENDING ON target fields, PL/I REFER fields, or fields referenced in record identification or record selection criteria. If a required field would have a negative or zero start column value under the supplied offset, the offset is invalid, and thus not allowed. If the first element of a dimensioned field is at a zero or negative start location, that field (all array elements) is removed from the display.

The offset is applied before values are calculated for use in identification or selection criteria.

Related topics