Admin Production rocket
Current Publication

INITIAL

Enterprise Developer for Visual Studio 2017 V7.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

INITIAL

Abbreviation: INIT

INITIAL is a storage class attribute that specifies the initial value of a variable or member of a structure. The INITIAL attribute has two formats. The first specifies an initial constant, expression, or variable whose value is assigned to a variable when storage is allocated to it. The second format specifies that the CALL option invokes a procedure to perform initialization at allocation. The variable is initialized by assignment during the execution of the called routine, rather than by the routine being invoked as a function that returns a value to the point of invocation. The formats of the INITIAL attribute are:

Format 1:

INITIAL(item[,item]…)

where item is:

*|constant|variable|expression|iteration-spec 

where iteration-spec is:

(iteration-factor) iteration-item

where iteration-item is:

*|constant|variable|expression

where iteration-factor is:

*|expression

where constant is:

arithmetic-constant|bit-constant|character-constant|
entry-constant1 label-constant
Note: Open PL/I supports the ANSI PL/I Subset G specification for the INITIAL attribute, not the full mainframe PL/I specification.

In the context of item or iteration-item, asterisk ( * ) specifies that the element is to be left uninitialized.

In the context of iteration-factor, asterisk (* ) specifies that the entire array is to be initialized with the iteration-item.

For static variables, any value specified in an INITIAL attribute is assigned at the time the program is first loaded into memory for execution.

For automatic variables, which are allocated at each activation of the declaring block, any specified initial value is assigned at the time of each allocation.

For based and controlled variables, which are allocated at the execution of ALLOCATE statements, any specified initial value is assigned at the time of each allocation.

The INITIAL attribute may not be used with variables of storage classes other than those mentioned above.

Only constant values with no operations can be specified in the INITIAL attribute for static variables, with the following exceptions:

  • The NULL() built-in function can be used to initialize a static pointer variable.
  • Expressions containing concatenated string constants can be used to initialize static string variables. For example:
    DECLARE STRING CHAR(11) STATIC INIT ('MICRO'|| ' FOCUS');

Format 2:

INITIAL CALL entry(arg[,arg]…)

The INITIAL call cannot be used to initialize static data.