HP COBOL II/XL Quick Reference Guide (31500-90015)
C: 1
Appendix C MPE/XL Run-Time Trap Handling
The HP COBOL II/XL compiler handles run-time traps for cases of bounds
checking, divide by zero, invalid GOTO statements, and alignment errors.
The run-time environment is set using the MPE XL SETVAR command with the
variable COBRUNTIME. The syntax for this command is:
SETVAR COBRUNTIME "
string
"
[REV BEG]
where
string
is a string of nine uppercase or lowercase[REV END]
characters representing run-time options A, C, D, I, M, N, or blank as
shown in the following table.
Table C-1. Run-Time Error Handling Options
----------------------------------------------------------------------------------------
| | |
| Option | Meaning |
| | |
| A or blank | Print the error message and abort (the default). |
| | |
| C | Print the error message and continue. |
| | |
| D | Print the error message and enter debug mode. |
| | |
| I | Ignore the error (continue without printing an error message). |
| | |
| M | Print the error message, change the illegal digit to some legal |
| | digit, and continue. This option is only valid for illegal decimal |
| | or ASCII digit errors. (See character position 1 in the next table.) |
| | When used for other errors, M is treated as a blank. |
| | |
| N | Change the illegal digit to a legal digit and continue without |
| | printing an error message.[REV BEG] This option is only valid for |
| | illegal decimal or ASCII digit errors in positions 1, 7, and 8. See |
| | the description of character positions 1, 7, and 8 in the next table |
| | for details. When used in other positions,[REV END] N is treated as |
| | a blank. |
| | |
----------------------------------------------------------------------------------------
Each character position in the above COBRUNTIME string represents a
specific trap that you can request, as shown in the following table:
Table C-2. Character Position in Specific Traps
-------------------------------------------------------------------------------
| | |
| Character | |
| Position | Trap Type |
| | |
-------------------------------------------------------------------------------
| | |
| 1 | Illegal ASCII or decimal digit. |
| | |
-------------------------------------------------------------------------------
| | |
| 2 | Range error (OCCURS DEPENDING ON identifier, subscript, |
| | index, or reference modification out of bounds). |
| | |
-------------------------------------------------------------------------------