View previous topic :: View next topic
|
Author |
Message |
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Thanks Dick !!! |
|
Back to top |
|
|
|