Page 1 of 1

achieving the old value

Posted: Sat Jan 04, 2003 12:56 am
by sankar18
Hi All

In a seq 1, runs a job1, if job1 executed successfully, it will execute seq 2,runs job2, if job2 executed successfully, it will execute seq 3,runs job3, if seq 3 is warning,i need rollback the action took in job2. In job2 i am updating a flatfile, i want to rollback the update.

Thanks in Advance,
T Sankar

Posted: Sat Jan 04, 2003 10:53 am
by chulett
Well, there really isn't any way to 'rollback' updates made to a flat file, not in the way the term is used in relational databases. Technically, you couldn't do this in a relational database because once you launched job3, job2 would have already committed its work. You'd need to do everything in one job, AFAIK, to make this workable.

In either case, it sounds to me like you need to design your jobs so that the updates can be programmatically 'undone'. Either keep an original copy of the flat file you can fall back to if job3 fails or write a fourth job that is executed after job3 fails that 'undoes' the updates done to the file, if that is even possible (hard to say without knowing what sort of updates you are doing).

-craig

-craig

Posted: Sat Jan 04, 2003 3:53 pm
by ray.wurlod
The Sequential File stage and the Hashed File stage each include the capability to preserve a copy of the output file before overwriting it.
Alternately you could execute an appropriate operating system command to achieve the same thing (through ExecSH/ExecDOS or DSExecute).