IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cursor Question


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manikant pathak

New User


Joined: 09 May 2005
Posts: 37
Location: bangalore

PostPosted: Tue Apr 08, 2008 12:03 pm
Reply with quote

Hi All,

Pgm A calls Pgm B.
PGM A.

Accept input (Any one out of 5 possibilities)

CALL PGM B using Input.

|----------------------------------------------------------
|PGM B.
|
|Validate Input.
|
|Opens the related cursor.
|
|Retrieve the row
|
|send the control back to PGM A.
|----------------------------------------------------------

Checks whether all the rows are retrieved or not.

If yes processes the data.

If no again calls the PGM B with an alternate entry point.

My questions here is:

1. Is the second call going to open a new Run Unit? If no, then what happens to the cursor which I opened during the first call but not closed it.

Regards,
MKP
2. What happens to the cursor if the call returns to the Main Program. I am not sure but I think it is still open as our Run Unit is still in progress.

2.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Apr 08, 2008 12:26 pm
Reply with quote

this concerns batch:

1. no same run unit - actually same task. Unless you use the multitask options of cobol3 and start a new task, everything is in the original task.

since you are using entrypoints, that means you are doing a static link which tell me that you are not using cobol3.

2. the cursor is not closed until the task is terminated or the cursor is closed explicitly.
Back to top
View user's profile Send private message
manikant pathak

New User


Joined: 09 May 2005
Posts: 37
Location: bangalore

PostPosted: Tue Apr 08, 2008 12:34 pm
Reply with quote

Thanks DB. So if the cursor is not closed and we do a ftech in the subprogram it will continue from the next record, right?

Regards,
MKP
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top