Working-Storage - Initializing at Compile Time



Is there a way to initialize the fields of Working-Storage at compile time?


To initialize Working-Storage at compile time, use this option:


This option causes the compiler to initialize Working-Storage. Normally, the compiler will initialize all data items to spaces or the value specified with the "-Dv" option, except for those items given a VALUE clause. If this option is specified, data items are initialized according to their type:

Alphabetic, alphanumeric, alphanumeric edited, and numeric edited items are initialized to spaces.

Numeric items are initialized to zero.

Pointer items are initialized to null.

Index items are initialized to the value 1.

Automatic initialization applies only to Working-Storage and does not apply to any item that (a) is given a VALUE clause, (b) is EXTERNAL, or (c) is subordinate to a REDEFINES phrase.

Old KB# 2718
Comment List