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

will the cursor be closed when control is returned ?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Oct 20, 2006 2:59 pm
Reply with quote

Hi
My main program is calling a subroutine (online ) ..in sub a cursor is opened ...but in case the control is returned back bfore i can close the cursor will the cursor be closed once control goes back to the main program ..... the subroutine can again be called from the main program depending on the feedback frm the sub ......
pls help ...

tia
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Fri Oct 20, 2006 8:35 pm
Reply with quote

Hi !

The cursor is not closes unless the logical unit of work (LUW) is ended.

In your example, the sub-pgm has to open and close the cursor for correct handling. If you write sub-pgms for getting data from db2 perhaps do it like this:

main -> call sub, function=Open / sub do the open and goback
main -> call sub, function=Fetch / sub does a fetch and goback
... with data in comarea
main processing data

main -> call sub, function=Fetch / sub does fetch and returns 100 EOF
main -> calls sub, Function=Cole / sub closes cursor

Hope it helps, regards, UmeySan
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Help Control-R IBM Tools 2
No new posts Try to understand IMS control block IMS DB/DC 0
No new posts Control-M Delay All Other Mainframe Topics 0
No new posts Issued a CMD call for /DIS & it r... IMS DB/DC 3
Search our Forums:

Back to Top