Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

GOBACK/COMMIT with a called proram - will it work?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Thu Dec 01, 2011 3:54 am    Post subject: GOBACK/COMMIT with a called proram - will it work?
Reply with quote

Hi DB2 people,

Does the GOBACK statement in a called COBOL DB2 program create an implicit COMMIT to the database?

Or does the GOBACK statement when used in Sub-program return control back to Main program and an IMPLICIT COMMIT will not be performed, and the Explicit commit will need to be coded.

Thanks so much in Advance to you all,
Sharon
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Dec 01, 2011 5:03 am    Post subject:
Reply with quote

have had a little too much of myself lately,
so i offer this:

This is written from a Batch prospective,

as far as what go on in a COBOL Thread (task):
there is no such thing as an IMPLICIT or EXPLICIT COMMIT.
either you code for it and
-------the unit-of-work for that task is COMMITted, and you continue executing, db2 storing current-unit-of-work-status (type stuff) until the next COMMIT or ROLLBACK or STOP RUN (or GOBACK from the main module)
or you don't and
-------a COMMIT or ROLLBACK will be invoked by whatever is running the COBOL EXEC,
when the RUN UNIT/THREAD/TASK ends.
which is when all GOBACKs or a STOP RUN have been executed.

as far as the db2 flow (unit-of-work) is concerned,
the effect of the COBOL code is the same as the final EXIT (implicit or explicit icon_lol.gif )
of a PERFORM.
A GOBACK of a COBOL program is only a bunch of IFs and BRs (GO TOs)
if the returned-to program is part of the operating-system that invoked the mainmodule,
then we enter into the clean-up phase of the 'executor'
(i think that is what it is called )
part of ops-sys and when the detach to db2 (task disconnect) is made,
db2 checks for outstanding commits,
depending upon db2 bind parms, db2 either issues a COMMIT or ROLLBACK,
which will release all memory, dasd and whatever else db2 has claimed for the last unit-or-work for the task.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Dec 01, 2011 5:23 am    Post subject:
Reply with quote

Sorry, did not answer your question.

i tried to give you another perspective,
inclusive of jargon,
with which you may want to use when you rewrite your assumptions,
and answer your own question.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 5 Tue Nov 29, 2016 9:25 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
This topic is locked: you cannot edit posts or make replies. How to supply called sub-program from... dchristensen JCL & VSAM 25 Wed Sep 14, 2016 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us