Automatic data and initial data is placed in the initial state every time the function, method or program in which it is described
is activated.
Static data is placed in the initial state:
- The first time the function, method or program in which it is described is activated in a run unit.
- The first time the program in which it is described is activated after the execution of an activating statement referencing
a program that possesses the initial attribute and directly or indirectly contains the program.
- The first time the program in which it is described is activated after the execution of a CANCEL statement referencing the
program or CANCEL statement referencing a program that directly or indirectly contains the program.
When data in a function, method or program is placed in the initial state, the following occurs:
- Internal data items in the Working-Storage Section
and Local-Storage Section
that are subject to VALUE clauses are initialized as described in the section The VALUE Clause in the chapter Data Division - File and Data Description.
- Internal data items in the Working-Storage Section that are not subject to VALUE clauses and internal data items in the File
Section are initialized in accordance with the setting of the DEFAULTBYTE Compiler directive.
- Internal data items in the Linkage Section
and Local-Storage Section
that are not subject to VALUE clauses and are undefined.
-
Internal data items in the Thread-Local Section and the Object Section are treated in the same way as internal data items
in the Working-Storage Section.
- The function, method or program's internal file connectors are initialized by setting them to not be in any open mode.
- The attributes of screen items are set as specified in the screen description entry.