SSRANGE
SSRANGE affects whether code is generated to check for out-of-range storage references.
- Default
- SSRANGE=NO
ZLEN
|NOZLEN
- Generates code that checks subscripts, reference modifications,
variable-length group ranges, and indexes at run time to ensure that they
do not refer to storage outside the area assigned. It also verifies
that a table with ALL subscripting, specified as a function argument,
contains at least one occurrence in the table.
The generated code also checks that variable-length items do not exceed their defined maximum length as a result of incorrect setting of the OCCURS DEPENDING ON object. For unbounded groups or their subordinate items, checking is done only for reference modification expressions. Subscripted or indexed references to tables subordinate to an unbounded group are not checked.
The ZLEN and NOZLEN suboptions control how the compiler checks reference modification lengths:
- If ZLEN is in effect, the compiler will generate code to ensure that reference modification lengths are greater than or equal to zero. Zero-length reference modification specifications will not get an SSRANGE error at run time.
- If NOZLEN is in effect, the compiler will generate code to ensure that reference modification lengths are greater than or equal to 1. Zero-length reference modification specifications will get an SSRANGE error at run time. This is compatible with how SSRANGE behaved in previous COBOL versions.
MSG
|ABD
- The
MSG
andABD
suboptions control the runtime behavior of the COBOL program when a range check fails.- If
MSG
is in effect and a range check fails, a runtime warning message will be issued. Also, the program will continue executing and might potentially identify other out-of-range conditions. - If
ABD
is in effect and a range check fails, the first out-of-range condition will result in a runtime error message and the program will abend. You can find the next potential out-of-range condition by fixing the first out-of-range condition and then recompiling and running the program again. To identify all other potential out-of-range conditions, you might need to repeat this process several times.
Performance consideration:
If anything other than SSRANGE=NO is in effect at compile-time
, the object code size will be increased, and the runtime overhead will also be increased to accomplish the range checking.
- If
- NO
- No code is generated to perform subscript or index checking at run time.
Note:
If you specify
anything other than SSRANGE=NO
, range checks are
generated by the compiler and the checks are always executed at run
time. The compiled-in range checks cannot be disabled even if you
specify the Language Environment® runtime option
CHECK(OFF). 



