COBOL - Opções de compilação - SSRANGE


Volta a página anterior

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

Opções de compilação - SSRANGE

Use SSRANGE to generate code that checks whether subscripts (including ALL subscripts) or indexes try to reference an area outside the region of the table.
Each subscript or index is not individually checked for validity; rather, the effective address is checked to ensure that it does not cause a reference outside the region of the table.

Variable-length items are also checked to ensure that the reference is within their maximum defined length.

SSRANGE option syntax

Default is: NOSSRANGE

Abbreviations are: SSR|NOSSR

Reference modification expressions are checked to ensure that:

  • The starting position is greater than or equal to 1.
  • The starting position is not greater than the current length of the subject data item.
  • The length value (if specified) is greater than or equal to 1.
  • The starting position and length value (if specified) do not reference an area beyond the end of the subject data item.

If SSRANGE is in effect at compile time, range-checking code is generated. You can inhibit range checking by specifying the CHECK(OFF) runtime option. Doing so leaves range-checking code dormant in the object code.
Optionally, the range-checking code can be used to aid in resolving unexpected errors without recompilation.

If an out-of-range condition is detected, an error message is generated and the program is terminated.

Remember:
Range checking is done only if you compile a program with the SSRANGE option and run it with the CHECK(ON) option.


© Copyright IBM Corp.