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
 

 

Retaining Cursor Position

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

New User


Joined: 28 Dec 2005
Posts: 24

PostPosted: Tue Jun 26, 2007 5:00 am    Post subject: Retaining Cursor Position
Reply with quote

Can anyone tell me how to retain cursor position when control is passed from program A to prog-B and when i return back to prog-A i dun hav the cursor position.....


I'm using a cursor in prog-A to read a policy table and when i find a particular record, I call prog B passing the policy information using Linkage Section. Then i do some processing and the control is returned back to prog-A but I dun't hav the cursor position anymore......

Can anyone please tell me how do I overcome this ??
Back to top
View user's profile Send private message

Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Tue Jun 26, 2007 12:01 pm    Post subject:
Reply with quote

catchyblues,
its possible your prog-B is doing a Commit / Rollback during its processing and such an operation would close all the open cursors in a LUW what you can use to avoid such a situation is Open the cursor using "WITH HOLD" statement which would retain the cursor position on a Commit / Rollback operation.
Hope this helps
Nimesh
Back to top
View user's profile Send private message
catchyblues

New User


Joined: 28 Dec 2005
Posts: 24

PostPosted: Tue Jun 26, 2007 2:28 pm    Post subject:
Reply with quote

Hi,


I'm basically doing a read on a View in prog-A and calling prog-B.

In prog-B, i'm reading the same table on which the view was created. So when I exit prog-B, the cursor needs to positioned on the 2nd record on the View. Will a with-hold option work in this case ?

newayz I'll try doing that .... thanx for ur help




Nimesh.Srivastava wrote:
catchyblues,
its possible your prog-B is doing a Commit / Rollback during its processing and such an operation would close all the open cursors in a LUW what you can use to avoid such a situation is Open the cursor using "WITH HOLD" statement which would retain the cursor position on a Commit / Rollback operation.
Hope this helps
Nimesh
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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm
No new posts Adjust Heading Position in Easytrieve thesumitk CA Products 4 Mon Dec 21, 2015 3:26 pm


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