View previous topic :: View next topic
|
Author |
Message |
manikant pathak
New User
Joined: 09 May 2005 Posts: 37 Location: bangalore
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
manikant pathak
New User
Joined: 09 May 2005 Posts: 37 Location: bangalore
|
|
|
|
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 |
|
|
|