OFFSET

Use the OFFSET function when you need to know the position of a particular data object within its card object.

The OFFSET returns an integer representing the offset of the specified object within the data.

Syntax:
OFFSET (single-object-expression)
Meaning:
OFFSET (object_whose_offset_is_needed)
Returns:
A single integer

OFFSET returns the offset, in bytes, of the specified object within its card object, beginning at offset 0. For an object that has an initiator, the offset will apply to the first byte of the data. For an object that is right-justified with pad characters, OFFSET will return the offset of the first byte of data.

The OFFSET function works the same for output objects as it does for input objects.

Examples

  • OFFSET (Application:LoanData)

    In this example, if the first character of the first occurrence of the object Application occurs 210 bytes from offset 0 within LoanData, the OFFSET function returns 210.

Related function

  • SIZE