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
 

 

will the cursor be closed when control is returned ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: will the cursor be closed when control is returned ?
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: 755
Location: Germany

PostPosted: Fri Oct 20, 2006 8:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


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