DB2 + File update



DB2 + File update

Postby sinmani » Thu May 02, 2013 11:47 am

Q. We have a COBOL DB2 Program which reads records from a file A.
Updates DB2 table with a value from input file. Updates another VSAM file B by adding value from input file to a field in the VSAM file B.
Now suppose the job abends after updating N records.
How will you resume the job and proceed ahead.
Note : The developer forgot to take back up of file and DB2 before running the job.
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: DB2 + File update

Postby enrico-sorichetti » Thu May 02, 2013 12:35 pm

Note : The developer forgot to take back up of file and DB2 before running the job.


if You can exactly determine the N and the updates are reversible computations and/or file inserts
just write a program reversing the computations an deleting the extra record inserts
REMEMBER TO PROCESS THE INPUT RECORDS BACKWARDS
(consider what would happen if you had taken a decision based on a previous update )

if You cannot determine exactly the N and the updates are not reversible ( E.G. string substitutions ) or file deletes
You will have to travel on a long and windy ant thorny road for reconciliation

if You did not issue any commits an abed will rollback all the db2 changes, so DB2 should be clean, but beware ...

and in any case something will come back later to bite Your *** :geek:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times


Return to Interview Questions

 


  • Related topics
    Replies
    Views
    Last post