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

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 6965
Location: porcelain throne

PostPosted: Thu Dec 01, 2011 5:03 am
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: 6965
Location: porcelain throne

PostPosted: Thu Dec 01, 2011 5:23 am
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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
No new posts Intertest Batch issue with called ass... COBOL Programming 4
No new posts Negative value - packed field - Natur... Java & MQSeries 0
No new posts TWS - ETT File triggering does not wo... IBM Tools 4
Search our Forums:


Back to Top