Controls the behavior of your program if it tries to divide by zero in a statement that has no ON SIZE ERROR phrase.
Syntax:
>>-.---.-.-------CHECKDIV-"dialect"-.-----><
+-/-+ +.----.-CHECKDIV-----------+
+-NO-+
Parameters:
-
dialect
- One of ANSI, ISO2002, COBOL370, ENTCOBOL, MVS, OS390, OSVS, VSC2 .
Properties:
Default:
|
CHECKDIV"ANSI"
|
Phase:
|
Syntax check
|
$SET:
|
Initial
|
Comments:
With CHECKDIV, CHECKDIV"ANSI" or CHECKDIV"ISO2002" 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.