is multiple STOP RUN are valid?
Moderators: dbzTHEdinosauer, Moderator Group
is multiple STOP RUN are valid?
1. Coding Multiple STOP RUN is valid?
if yes which will take top precedence?
if yes which will take top precedence?
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
statements after the STOP RUN is valid??
the statements coded after the STOP RUN, is valid???
STOPRUN vs GOBACK
arunaa27 wrote: But, DO NOT USE STOP RUN in your COBOL coding.... IT IS NOT ADVISABLE... Instead of this, you can use GOBACK.
Why are suggesting GOBACK instead of STOP RUN.
Are you talking about COBOL CICS programs?
Natarajan
Chennai
Chennai
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
I agree with Arun: STOP RUN is an old instruction from back in the days when we did not code modularly. you can code GOBACK instead of STOP RUN anywhere. It is considered good practice now-a-days not to use STOP RUN.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
they can never be CALLed.
main modules coded with GOBACK, that acquire their input and output from other than linkage, could be used as submodules.
a lot easier to just always use GOBACK, and not rely on the coder to make the differentiation;
looking thru these forums and experience in the field has lead me and others to insist on GOBACK.
Just one less problem to deal with.
Besides, how many main modules are written in comparision to CICS or submodules?
But if you want to code STOP RUN all the time, that is your business.
you just have to remember to use GOBACK when appropriate.
main modules coded with GOBACK, that acquire their input and output from other than linkage, could be used as submodules.
a lot easier to just always use GOBACK, and not rely on the coder to make the differentiation;
looking thru these forums and experience in the field has lead me and others to insist on GOBACK.
Just one less problem to deal with.
Besides, how many main modules are written in comparision to CICS or submodules?
But if you want to code STOP RUN all the time, that is your business.
you just have to remember to use GOBACK when appropriate.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
My current shop will not allow STOP RUN in any production code.
The GOBACK statement functions like the EXIT PROGRAM statement when it is coded as part of a called program and like the STOP RUN statement when coded in a main program.
One might ask , Does any version of COBOL support STOP RUN anymore?
While the compiler still supports STOP RUN, many organizations do not allow it to be used. One of the things checked in the promotion process is that GOBACK is used and there is no STOP RUN in the code.
The GOBACK statement functions like the EXIT PROGRAM statement when it is coded as part of a called program and like the STOP RUN statement when coded in a main program.
One might ask , Does any version of COBOL support STOP RUN anymore?
While the compiler still supports STOP RUN, many organizations do not allow it to be used. One of the things checked in the promotion process is that GOBACK is used and there is no STOP RUN in the code.
Regards,
Anuj
Anuj
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Other exception here can be IMS-COBOL program. IMS programs run under the control of batch initilization module DFSRRC00.If you code Stop Run the control is return to OS instead of DFSRRC00. So code GOBACK to give the control back to the called module its DFSRRC00.Natarajan wrote:Is there any specific reason for suggesting GOBACK instead of STOP RUN , even in normal cobol programs ( i am not talking about sub programs, cics programs )
Regards,
Anuj
Anuj
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page