View previous topic :: View next topic |
Author |
Message |
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Sun Dec 10, 2006 8:13 pm Post subject: Psuedo Converstational program - cursor is closed |
|
|
hi there,
program A only performs screen operations.
program B only performs db2 i/o operations.
firstly program A invokes program B's "open cursor" function in order to open a db2 cursor. a set of lines from a db2 table is selected;
control returns to program A and a sqlcode 0 is received from program B;
program A invokes program B's "fetch cursor" function, in order to read the first line of the previously opened cursor;
control returns to program A once again but now a -501 sqlcode is received from program B;
the cursor previously successfully opened by program B is no longer available.
i was told it happens because i am running in a cics pseudo conversational mode.
how to get a sqlcode 0 after calling program B for the second time?
thanks |
|
Back to top |
|
|
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Sun Dec 10, 2006 8:15 pm Post subject: |
|
|
i forgot to mention:
program A is cobol cics;
program B is cobol cics/db2.
thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Sun Dec 10, 2006 8:16 pm Post subject: |
|
|
jctgf,
In a psuedo-converstational program every time you invoke the program B it is treated as the first time. So you need to open and fetch the rows once again. You cannot issue a direct fetch.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sun Dec 10, 2006 8:29 pm Post subject: |
|
|
cics link to pgm b with a copybook that contains a cursor start point (key for second screen) and a table to contain enough rows to fill a screen. pgm a invokes pgm b only once per 'screen fill', and pgm a saves that key of the first and last displayed to enable scrolling. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
nagasadhu Beginner
Joined: 08 Jul 2006 Posts: 17 Topics: 6
|
Posted: Thu Dec 14, 2006 3:16 am Post subject: |
|
|
Would it make a difference if you use CURSOR WITH HOLD option? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Dec 14, 2006 8:07 am Post subject: |
|
|
Quote: |
Would it make a difference if you use CURSOR WITH HOLD option?
|
No
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|