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

How Cursor position is maintained in CICS program?


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

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Fri Sep 21, 2007 7:31 pm
Reply with quote

Hi,

In a COBOL+DB2+CICS program, what happens to the DB2 CURSOR when the control enters the program through Pseudo conversation for the second time?

How the program maintains the Cursor position in the table?

Thanks,
Rz061m
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2007 7:45 pm
Reply with quote

rz061m wrote:
Hi,

In a COBOL+DB2+CICS program, what happens to the DB2 CURSOR when the control enters the program through Pseudo conversation for the second time?

How the program maintains the Cursor position in the table?

Thanks,
Rz061m

You have to keep track of the position and open and reposition the cursor yourself.
Back to top
View user's profile Send private message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Fri Sep 21, 2007 8:01 pm
Reply with quote

How do i keep track of it ?

Is there any special register/varibale that needs to be included in the COMMAREA to have the Cursor position and use it next time.

I need of some sample code, if possible.
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Fri Sep 21, 2007 8:14 pm
Reply with quote

Sample: Let's say your table is:

EMP_NUMBER (Unique Key)
EMP_NAME

Your SQL must be:

SELECT EMP_NUMBER, EMP_NAME from table
WHERE EMP_NUMBER > :RESTART-EMP-NUMBER
ORDER BY EMP_NUMBER

You must save RESTART-EMP-NUMBER in your commarea. Note that your ORDER BY columns must form a unique key. When your unique key consists of multiple columns then your WHERE condition will need to contain ORs...
Back to top
View user's profile Send private message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Fri Sep 21, 2007 10:16 pm
Reply with quote

Is the above mentioned is a standard logic used in all the CICS+DB2 program ?

So for the very first time do i need to move NULL value to the restart fields in the WHERE clause ?

Thanks,
RZ061M
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 Using API Gateway from CICS program CICS 0
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top