Previous Topic Next topic Print topic


CHECKDIV

Syntax:

>>-.---.-.-------CHECKDIV-"dialect"-.-----><
   +-/-+ +.----.-CHECKDIV-----------+
          +-NO-+

Parameters:

dialect
One of ANSI, COBOL370, ENTCOBOL, MVS, OS390, OSVS, VSC2 .

Properties:

Default: CHECKDIV"ANSI" (Dialect)
Phase: Syntax check
$SET: Initial

Comments:

With CHECKDIV or CHECKDIV"ANSI" specified, the program continues with an undefined result if it tries to divide by zero. With NOCHECKDIV set, the behavior is undefined.

Specifying CHECKDIV"COBOL370", CHECKDIV"ENTCOBOL", CHECKDIV"MVS", CHECKDIV"OS390", CHECKDIV"OSVS" or CHECKDIV"VSC2" has the same effect; trying to divide by zero produces run-time error 048 (Attempt to divide by zero). This error can be disabled using the -O run-time system switch.

Setting NOCHECKDIV results in optimal code for divides.

This directive has no effect on arithmetic statements that use the ON SIZE ERROR phrase.

Previous Topic Next topic Print topic