Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Cursor Question

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Cursor Question
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: 6968
Location: porcelain throne

PostPosted: Tue Apr 08, 2008 12:26 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us