MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Psuedo Converstational program - cursor is closed

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Sun Dec 10, 2006 8:13 pm    Post subject: Psuedo Converstational program - cursor is closed Reply with quote

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
View user's profile Send private message Send e-mail
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Sun Dec 10, 2006 8:15 pm    Post subject: Reply with quote

i forgot to mention:

program A is cobol cics;

program B is cobol cics/db2.

thanks
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Sun Dec 10, 2006 8:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sun Dec 10, 2006 8:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
nagasadhu
Beginner


Joined: 08 Jul 2006
Posts: 17
Topics: 6

PostPosted: Thu Dec 14, 2006 3:16 am    Post subject: Reply with quote

Would it make a difference if you use CURSOR WITH HOLD option?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Dec 14, 2006 8:07 am    Post subject: Reply with quote

Quote:

Would it make a difference if you use CURSOR WITH HOLD option?


No

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group