Working-Storage Section
The Working-Storage
Section contains descriptions of data items used by the program internally.
General Format:
[ WORKING-STORAGE SECTION. ]
[ ws-data-level ws-data-description ] …
Syntax:
The clauses supported by the data description are described in the Data Description section.
General Rules:
ws-data-level
is a data level number between 01 and 49 (inclusive), 66, 77, 78, or 88. For more information about data level numbers, see the Data Level Numbers section.ws-data-description
describes the format and size of a data item that is used by the program internally.- The default data initialization behaviour of the runtime corresponds to the declaration of the
program in the
PROGRAM-ID
clause in theIDENTIFICATION DIVISION
. If the program is described asIS INITIAL PROGRAM
,IS COMMON PROGRAM
, orIS RECURSIVE PROGRAM
, the default behaviour of the runtime is to initialize alphanumeric data items to spaces, numeric data items to zeroes, and pointer data items to null every time the program is loaded. - If there is no specific description, the program is considered a
RESIDENT
program, and the default behaviour of the runtime is to initialize alphanumeric data items to spaces, numeric data items to zeroes, and pointer data items to null the first time the program is loaded. When the program is called subsequently, the data items in theWorking-Storage
Section retain their state, unless the program has been the target of theCANCEL
statement. Working-Storage
variables may be created with an initial value using theVALUE
clause.- The default data initialization behaviour of the runtime can be altered with the
default-byte-setting
anduse-defaultbyte
settings in the compiler configuration file.
For example, to cause allWorking-Storage
data items except those with explicitVALUE
statements to be initialized to low-values when a program is initially loaded:
In the compiler configuration flag, set:
Defaultbyte: 0
Use-defaultbyte: yes