Previous Topic Next topic Print topic


REFER

REFER is an attribute of a based structure that specifies that the value of one member is used to determine the amount of storage space allocated for another member of the same structure. Its format is:

expressionREFER(variable)

where expression is evaluated and converted to Fixed Binary (15) and is the initial extent when the based structure is allocated. Variables used in the expression being evaluated as operands must not belong to the member containing the REFER attribute.

variable must be a variable contained by the structure being allocated and defined prior to the extent whose size it determines. For example:

DECLARE 1 STRUC BASED(P),
      2 I FIXED BINARY,
      2 A CHARACTER(20 REFER(I));

Multiple REFER attributes are allowed in the declaration of a structure.

Previous Topic Next topic Print topic