ON command (PL/I)
The ON
command establishes the actions to be executed
when the specified PL/I condition is raised. This command is equivalent
to AT OCCURRENCE
.
- condition_name
- A valid PL/I
CONDITION
condition name. - file_reference
- A valid PL/I file constant, file variable (can be
qualified), or an asterisk (*). If you use an asterisk (*), the breakpoint
is activated for all file references associated with the condition
used in the
ON
command. - command
- A valid z/OS® Debugger command.
Usage notes
- You must abide by the PL/I restrictions for the particular condition.
- An
ON
action for a specified PL/I condition remains established until:- Another
ON
command establishes a new action for the same condition. In other words, the breakpoint is replaced. - A
CLEAR
command removes theON
definition.
- Another
- For Enterprise PL/I, you cannot use file variables in the file_reference field.
- The
ON
command occurs before any existingON
-unit in your application program. TheON
-unit is processed after z/OS Debugger returns control to the language. - The following are accepted PL/I abbreviations for the PL/I condition
constants:
ATTENTION
orATTN
FIXEDOVERFLOW
orFOFL
OVERFLOW
orOFL
STRINGRANGE
orSTRG
STRINGSIZE
orSTRZ
SUBSCRIPTRANGE
orSUBRG
UNDEFINEDFILE([file_reference])
orUNDF([file_reference])
UNDERFLOW
orUFL
ZERODIVIDE
orZDIV
- The preferred form of the
ON
command isAT OCCURRENCE
. For compatibility with PLITEST and INSPECT, however, it is recognized and processed.ON
should be considered a synonym ofAT OCCURRENCE
. AnyON
commands entered are logged asAT OCCURRENCE
commands. - The
ON
command cannot be used while you replay recorded statements by using thePLAYBACK
commands.
Examples
- Display a message if a division by zero is detected.
ON ZERODIVIDE BEGIN; LIST 'A zero divide has been detected'; END;
- Display and patch the error character when converting character
data to numeric. Given a PL/I program that contains the following statements:
DECLARE i FIXED BINARY(31,0); . .. .. i = '1s3';
The following z/OS Debugger command would display and patch the error character when converting the character data to numeric:ON CONVERSION BEGIN; LIST (%STATEMENT, ONCHAR); ONCHAR = '0'; GO; END;
'1s3'
cannot be converted to a binary number soCONVERSION
is raised. TheON CONVERSION
command lists the offending statement number and the offending character:'s'
. The data will be patched by replacing the's'
with a character zero,0
, and processing will continue.
Refer to the following topics for more information related to the material discussed in this topic.
- Related references
- AT OCCURRENCE command
- Enterprise PL/I for z/OS Language Reference