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
 

 

How Cursor position is maintained in CICS program?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How Cursor position is maintained in CICS program?
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    Post subject: Re: How Cursor position is maintained in CICS program?
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    Post subject:
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: 149
Location: Ottawa Canada

PostPosted: Fri Sep 21, 2007 8:14 pm    Post subject:
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    Post subject:
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    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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 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 Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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