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

Retaining Cursor Position


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts compare two file to find position/dat... SYNCSORT 2
No new posts Group selective VB records - Trailer ... DFSORT/ICETOOL 16
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
Search our Forums:

Back to Top