I am curious to hear opinions on something.  The current COBOL standard has an 
enhancement to the STOP RUN statement.  There are two new options, the ERROR 
phrase and the NORMAL phrase.  My first thought is that the NORMAL phrase could 
replace the RETURN-CODE special register, which is a non-standard IBM 
extension, for setting register 15 and thus the return code back to the OS.  An 
example is:


This would set R15 to a value of 16 and then terminate the run-unit normally.  
Essentially the same as moving 16 to RETURN-CODE and then doing a STOP RUN.  
The advantage to it, other than being supported by the COBOL standard, is that 
the RETURN-CODE special register can be unintentionally set (usually back to 
zero) if you do a CALL statement after setting RETURN-CODE.

My further thinking is that perhaps the ERROR phrase of STOP RUN could cause an 
intentional abend.


This could cause a U1234 abend (or possibly a specific user abend with the 1234 
being the "reason code"), which in turn would cause the run unit to "abnormally 
terminate" and do whatever abend processing your shop does.

Currently I believe the recommendation is to call the CEE3ABD routine (or 
CEE3AB2), and in the past one might call ILBOABN0.  Or in the case of our shop 
(I don't know the history/reasoning behind this) do an intentional data 
exception or division by zero.

Anyway it seems to me that an "official" COBOL method of doing this could be 
worthwhile.  I don't know if other languages such as C or PL/I have something 
similar.  All thoughts are welcome (preferably agreeing with me <grin>).

For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to