Both methods would need to be supported. How many COBOL programs exist with 
"MOVE x to RETURN-CODE. STOP RUN."
So what (other than standards "compliance") is the benefit to IBM to implement?



-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Frank Swarbrick
Sent: Wednesday, August 9, 2017 6:43 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: COBOL STOP RUN enhancement

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:

STOP RUN WITH NORMAL STATUS 16

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.

STOP RUN WITH ERROR STATUS 1234

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


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information 
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in 
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on 
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the 
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written 
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please 
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and 
other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------
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