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
 
On Cursors and same variable names in two programs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Fri May 07, 2010 12:41 pm    Post subject: On Cursors and same variable names in two programs
Reply with quote

I came across queries below :

1) In a COBOL-DB2 , Cursors are used to update the table . After updating few records the job abends . What the position of the cursor ??

I think the cursor will be still pointing to the current position or will be closed .

2) A program1 is calling Program2 having the same variable-names defined and passed through linkage section . What happens ??

I think it doesn't cause any issue (by default call is 'By reference' and different variables will be saved in the different storage locations though with the same name)
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri May 07, 2010 7:14 pm    Post subject:
Reply with quote

Hello,

Quote:
I think the cursor will be still pointing to the current position or will be closed .
After an abend, cursors no longer exist. . . The task has left the system.

Quote:
different variables will be saved in the different storage locations though with the same name)
The variables are the same data at the same address. Only addressability is passed to the called module not the data. Names do not matter in different modules/programs - the 2 are completely unaware of each other's data names.
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Fri May 14, 2010 1:43 pm    Post subject:
Reply with quote

Hi Dick ,

Apologies for late reply .

Quote:

"After an abend, cursors no longer exist. . . The task has left the system."


Does this mean the updated records will be rolled back (assuming commit is not issued) and cursors will not be availble ...

It would be great if you could suggest me to read some particular online meterial on this .
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri May 14, 2010 9:28 pm    Post subject:
Reply with quote

Hello,

Quote:
Does this mean the updated records will be rolled back (assuming commit is not issued) and cursors will not be availble ...
Yes. It is normal for any/all uncommitted updates to be "rolled back" when there is an abend. As i mentioned before, the task has "gone away", so there is no place for the cursor to exist.

Quote:
some particular online meterial on this
Suggest you look in the documentation for your release of db2. Search for things like "commit", "rollback", "locking", "unit of work" and so on. There is a considerable amount of info.
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Mon May 17, 2010 12:11 pm    Post subject:
Reply with quote

Thanks Dick !!!
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts pointers on using USS and C programs. Pedro All Other Mainframe Topics 0 Wed Oct 04, 2017 4:38 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am

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