IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

On Cursors and same variable names in two programs


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri May 07, 2010 7:14 pm
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
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

Moderator Emeritus


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

PostPosted: Fri May 14, 2010 9:28 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top