STGOPT
The STGOPT
option controls storage optimization.
Default is: NOSTGOPT
Abbreviations
are: SO
| NOSO
If you specify
STGOPT
,
the compiler might discard any or all of the following data items,
and does not allocate storage for them.- Unreferenced
LOCAL-STORAGE
andWORKING-STORAGE
level-77 and level-01 elementary data items - Level-01 group items if none of their subordinate items are referenced
- Unreferenced special registers
Note: The STGOPT option is ignored for data items
that have the VOLATILE clause. For details, see VOLATILE
clause.
The compiler
will not generate code to initialize discarded data
items to the values in their VALUE
clauses. In
addition, with STGOPT
, data items in the LOCAL-STORAGE
SECTION
can be reordered in memory to optimize performance.
When NOSTGOPT
is in effect,
the storage for all data items, including unreferenced data items,
is allocated by the compiler, data items are never reordered to improve
performance, and all data items defined with a VALUE
clause
are guaranteed to be initialized, even if they are unreferenced.
You can also use the RULES(UNREF
| NOUNREFALL | NOUNREFSOURCE)
option to control whether to
issue warning messages for unreferenced data items. For details, see RULES.