IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

At the end of ims cobol prog it is STOP RUN or GOBACK


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shivanag_2

New User


Joined: 08 Mar 2005
Posts: 1
Location: banglore

PostPosted: Fri Feb 10, 2006 1:48 pm
Reply with quote

i need to know what you will type at the end of any ims cobol program it is either stop run or goback
i am shivanag from hyderabad
Back to top
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Fri Feb 10, 2006 2:18 pm
Reply with quote

Hi

Goback

T & R
Prabs
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Feb 10, 2006 6:58 pm
Reply with quote

Coding STOP RUN or GOBACK would not depend on whether it is an IMS program or not.

It depends where it is being coded, whether in a MAIN Program or SUB PROGRAM.

Check out this from manuals....

Quote:
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.
The GOBACK statement specifies the logical end of a called program.


Regards,

Priyesh.
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Sat Feb 11, 2006 3:31 pm
Reply with quote

priyesh.agrawal wrote:
Coding STOP RUN or GOBACK would not depend on whether it is an IMS program or not.

It depends where it is being coded, whether in a MAIN Program or SUB PROGRAM.

Check out this from manuals....

Quote:
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.
The GOBACK statement specifies the logical end of a called program.


Regards,

Priyesh.



hi Priyesh,

it does depend on coding STOP RUN or GOBACK for IMS program. For IMS COBOL program we must code GOBACK instead of STOP RUN. only then all your resources acquired from IMS by the ENTRY statement will be released back to IMS.

suggestions welcomed.

gowtham
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Feb 15, 2006 12:12 pm
Reply with quote

Thank You Gowtham, for the corrections... I didn't know that... & misguided as I did quite often... icon_lol.gif

Regards,

Priyesh.
Back to top
View user's profile Send private message
Ajeevlal

New User


Joined: 19 Feb 2005
Posts: 9
Location: Chennai

PostPosted: Fri Feb 17, 2006 9:05 am
Reply with quote

U are correct Gowtham and ims cobol program acts as a sub program to IMS and hence we should use GOBACK to return the control to Main program (Which is IMS system)
Back to top
View user's profile Send private message
venkat1111_a1

New User


Joined: 14 Feb 2006
Posts: 8

PostPosted: Fri Feb 17, 2006 9:15 am
Reply with quote

ya , we write STOP RUN. at the end of the cobol prog.
Its manditary that every program ends with stop run, inspite of number of para s that we have used.If dont use STOP RUN the program compiler that is IGYCRCTL will through the error.

venkat
vijayawada
now in hyd.
Back to top
View user's profile Send private message
Ajeevlal

New User


Joined: 19 Feb 2005
Posts: 9
Location: Chennai

PostPosted: Sat Feb 18, 2006 7:50 am
Reply with quote

Hi Venkat,

i belive we use different compilers for normal COBOL program and IMS-COBOL program. So IMS-COBOL program should always be terminated with GO BACK and a normal COBOL prg shoud be terminated with STOP RUN.

Please correct me if i am wrong...
Back to top
View user's profile Send private message
parikshit

New User


Joined: 29 Apr 2007
Posts: 2
Location: Chennai

PostPosted: Fri May 11, 2007 6:55 pm
Reply with quote

IMS cobol pgm should be coded with GOBACK as above said it results in logical ending , also it results in proper closing of log files and VSAM files and deallocation of OS resources.
If STOP RUN it result in forced termaination of pgm, which i believe results in ABEND
Back to top
View user's profile Send private message
Mahendran3784

New User


Joined: 04 May 2007
Posts: 20
Location: INDIA

PostPosted: Tue May 29, 2007 2:17 pm
Reply with quote

With the use ENTRY statements, what do you mean acquiring resources?
Does it mean that those DBs will not be accessed by any other programs?

Mahendran B
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Tue May 29, 2007 6:42 pm
Reply with quote

IMS COBOL or IMS PL1 program are always Sub program to DLI Main program, and ENTRY statement gets control from DLI.
All the PCBs are loaded, DB pointers are setup, etc

Quote:
Does it mean that those DBs will not be accessed by any other programs?

It doesnt mean that those DBs will be locked.

Mahendran B - When starting a new discussion, better to post new topic rather than chaining in some other topic.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue May 29, 2007 9:26 pm
Reply with quote

I love it when IBM publishes information on the net icon_wink.gif

this one and this one for example. There's a sticky in the forum leading you to IMS information icon_idea.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 30, 2007 2:05 am
Reply with quote

Hello,

FWIW (For what it's worth), many sites i've worked with/supported will not allow STOP RUN in any production code.
Back to top
View user's profile Send private message
Libu Thomas

New User


Joined: 01 Jan 2007
Posts: 6
Location: India

PostPosted: Wed May 30, 2007 1:41 pm
Reply with quote

Check the version of IMS on which you are working. If the version is greater than 7, then both stop run and goback are valid and both do the same functionality if it is ur main program. if it is ur subprogram, use goback or exit program command.
Back to top
View user's profile Send private message
Karthi-acp

New User


Joined: 21 Apr 2007
Posts: 5
Location: India

PostPosted: Wed Jun 13, 2007 11:04 pm
Reply with quote

hello,
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.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Jun 14, 2007 1:05 am
Reply with quote

Always use GOBACK!
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Jun 14, 2007 1:14 am
Reply with quote

Quote:
Fri Feb 10, 2006 1:18 pm


This item was posted and, however we answered it, TS did not react at all. IMHO we should not pay any attention to it anymore.
Back to top
View user's profile Send private message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Wed Aug 29, 2007 11:32 pm
Reply with quote

Hi,

My understanding is that irrespective of IMS COBOL or a normal COBOL program, using GO BACK is good and this will give a chance to OS to release all the resources allocated to the program.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Aug 29, 2007 11:35 pm
Reply with quote

The answer is simple - ALWAYS-ALWAYS-ALWAYS use GOBACK. Does any version of COBOL support STOP RUN anymore - if it does, it shouldn't. GOBACK allows you to enjoy the privilege of becoming someone's called program.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 29, 2007 11:54 pm
Reply with quote

Hello,

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.

As many others have said - use GOBACK.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Thu Aug 30, 2007 2:50 am
Reply with quote

Yeah, I'm with Dick on this one. We don't allow STOP RUN anywhere in our code, we use GOBACK for everything.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top