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


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 - ZONECHECK

Use the ZONECHECK option to have the compiler generate IF NUMERIC class tests for zoned decimal data items that are used as sending data items.

Default is: NOZONECHECK

Abbreviations are: NOZC | ZC(MSG) | ZC(ABD)

MSG

The MSG suboption requests that an IF NUMERIC test be done on every use of zoned decimal data items as senders, and if the data is invalid (for example, NOT NUMERIC), a runtime warning message with the line number, data item name, data item content, and program name is issued.
ZONECHECK(MSG) is treated as if NUMCHECK(ZON,MSG) were in effect.

ABD

The ABD suboption requests that an IF NUMERIC test be done on every use of zoned decimal data items as senders, and if the data is invalid (for example, NOT NUMERIC), a terminating message is issued that causes an abend.
ZONECHECK(ABD) is treated as if NUMCHECK(ZON,ABD) were in effect.

Both ZONECHECK(MSG) and ZONECHECK(ABD) result in the compiler generating an implicit numeric class test for each zoned decimal data item that is referenced as a sender in a COBOL statement.
Receivers are not checked, unless they are both a sender and a receiver, such as data item B in the following sample statements:

ADD A TO B
DIVIDE A INTO B
COMPUTE B = A + B
INITIALIZE B REPLACING ALPHANUMERIC BY B

This checking is done before the data is used in each statement:

  • If the data is NOT NUMERIC, either a warning message for ZONECHECK(MSG) or a terminating message for ZONECHECK(ABD) is issued.
  • If the data is NUMERIC, the external behavior of the statement is the same as NOZONECHECK, other than being slower.

Restriction: For CALL statements, ZONECHECK checks BY CONTENT and BY VALUE data items that are numeric USAGE DISPLAY only, but it does not check BY REFERENCE parameters.

Performance considerations: ZONECHECK(MSG) and ZONECHECK(ABD) are much slower than NOZONECHECK, depending on how many zoned decimal data items are used in COBOL statements in a program.



© Copyright IBM Corp.