achieving the old value

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sankar18
Participant
Posts: 34
Joined: Mon Dec 16, 2002 1:18 am

achieving the old value

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
Post Reply