When PL/I requires a (possibly signed) integer constant, a restricted expression can be used. A restricted expression is an expression whose value is calculated at compile time and used as a constant. For example, you can use expressions to define constants required for:
- Character string lengths in STATIC declarations
- Character string lengths for other storage classes (non-structure members)
- Extents in static declarations
- Values used in static initialization
A restricted expression is identical to a normal expression, but requires that each operand be either:
- A constant or a named constant. You must declare a named constant before using it.
- A built-in function applied to a restricted expression(s).
If using a built-in function, it must be from one of the following categories:
- String-handling functions (COPY, REPEAT, LOW, and HIGH)
- Array-handling functions (DIMENSION, LBOUND, and HBOUND)
- Storage-control functions (BINARYVALUE, LENGTH, MAXLENGTH, NULL, OFFSETVALUE, POINTERVALUE, SIZE, STORAGE, and SYSNULL)
Restricted expression evaluation is done on RETURNS descriptors in entry declarations.