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
 

 

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 RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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