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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm


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