View previous topic :: View next topic
|
Author |
Message |
rz061m
New User
Joined: 03 Mar 2006 Posts: 48 Location: Chennai
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
rz061m
New User
Joined: 03 Mar 2006 Posts: 48 Location: Chennai
|
|
|
|
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 |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
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 |
|
|
rz061m
New User
Joined: 03 Mar 2006 Posts: 48 Location: Chennai
|
|
|
|
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 |
|
|
|