OFFSET primary command

The OFFSET primary command is available for editor sessions that use a template. The command adds a value to the record length of the Level 01 field and to the starting position of all fields within the record type, shifting the layout left or right in relation to the records being processed. An offset value of 0 removes a previously supplied offset.

If a positive offset is applied, 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. The offset is validated to ensure that required fields, such as OCCURS DEPENDING ON target fields or PL/I REFER fields, are not removed. 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.

If an OFFSET primary command is applied when an offset has already been supplied in the template, the offset value overwrites the offset value provided in the template.

Syntax

Read syntax diagramSkip visual syntax diagram
                  .-current 01-.   
>>-Offset--value--+------------+-------------------------------><
                  +-fieldname--+   
                  '-ALL--------'   

value
The offset value is a negative or positive integer, between -32760 and +32760, that shifts the layout left or right in relation to the records being processed. An offset value of 0 removes a previously supplied offset.
fieldname
The Level 01 field name to which the offset is applied.

The default is the currently displayed Level 01 field.

Current® 01
The currently displayed Level 01 field to which the offset is applied.
ALL
The offset value is applied to all the layouts described in the currently loaded template.

Related tasks and examples

While OFFSET is not available as a standalone function, the equivalent keywords OFFSETIN and OFFSETOUT are available in the following functions: