Page 1 of 1

undo changes

Posted: Thu Sep 08, 2005 2:42 am
by Luk
Hi!

I am using transformer to divide one input strem into four outputs.
Order of my output links is as following:

1 output writes data to hashfile1
2 output inserts data into database table1
3 output updates data into database table1
4 output modifies data in hashfile1

I want that any changes in database table and in hashfile were made only if every four outputs links don't return any errors.
Another option is to undo any erlier changes (made in database and in hashfile) made by erlier links , if error occures .

Is there some way to do this in DataStage?

Thanks for help

regards

Posted: Thu Sep 08, 2005 6:26 am
by chulett
Well, you can certainly 'undo' database changes via either 0 commit levels and constraints that check for rejected records or transaction grouping if that's available in your database stage. The Output Link variables like REJECTED, REJECTEDCODE, DMBSERROR, etc are what I am referring to.

The hashed files are another matter. I've never tried, but the docs say you can enable the 'Backup' option in the stage and then it will be rolled back to its 'original state' if the job aborts and is reset. Typically, you need to rebuild them.

Sometimes you can 'simplify' your error checking by setting the database stages to 'treat warnings as fatal'. Then, any little problem will abort the job and initiate a rollback of any uncomitted rows.