Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6966
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 Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us