IBM OS/390 User Manual

Page of 673
15.7.3 Options Specific to MVS
The options A, E and 0 are used only in a multitasking environment:
 A Dump all tasks
 O Dump only the task requesting the dump
 E Use of an exit
15.7.4 Compatibility
Parameters unsupported by the PL/I dump routines are ignored if they are used
when calling dump facilities.
15.8 Return Codes in PL/I
15.8.1 Setting Return Codes
It is possible to set return codes in PL/I. This capability, which already existed in
DOS when returning from a sub-program or a function, is now extended to main
programs. The function PLIRETC allows the setting of a return code. For
example, CALL PLIRETC (16); will set the return code to 16, thus allowing JCL to
test it by COND parameters in succeeding STEP statements.
15.8.2 Return Code Values
Note nevertheless the fact that the code returned from a PL/I program is the
SUM of the return codes provided by the user in the call to the function PLIRETC
(0 by default) and a code determined by the PL/I termination routines indicating
how the job terminated:
0000 Normal end
1000 STOP, EXIT, PLIDUMP(
S
′ ) ,  
PLIDUMP(
E
′ ) ,  
insufficient storage.
2000 ERROR condition and no ON ERROR or ON FINISH block.
4000 ERROR in PL/I management routines.
15.9 Forcing an ABEND
It can be useful to force PL/I to end in ABEND in certain cases. In practice, while
a user
s program may end abnormally, a PL/I program nevertheless ends quite
normally as far as the operating system is concerned. This can be accomplished
by executing the program with the NOSTAE option, writing an IBMBEERA routine
(see Programmer
s Guide and Execution Logic), or writing an assembler routine
to cancel PL/I
s STAE macro and issue the ABEND macro.
15.9.1 Use of DISP in the JCL
It is possible in the DISP parameter of the JCL statement to specify for example:
DISP=(NEW,CATLG,DELETE). The third parameter of DISP is used to indicate to
the operating system which route to follow in case of an ABEND. If PL/I
intercepts and handles errors, the system does not see an ABEND condition and
the file will be cataloged (second parameter) and not destroyed. It is therefore
necessary to force an ABEND. There are two possibilities:
Reassemble the module IBMBEERA to load register 15 with a non-zero
value.
Use the PLIREST function to cause a user ABEND.
344
VSE to OS/390 Migration Workbook