Easy way to do an update only when needed

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
simc
Premium Member
Premium Member
Posts: 16
Joined: Wed Jul 22, 2015 12:10 pm

Easy way to do an update only when needed

Post by simc »

so I`m a newbie with datastage, learning the ropes, so this might be a dumb question.

Is there and easy way/stage to do this?

So I want to insert new, and only update rows that have changed. Something like the SCD stage, but without the surrogate key.

For simplicity sake, three fields: Key, Data, Mod_Date

- new Key.....insert with sysdate as Mod_Date
- existing Key with existing Data.... do nothing
- Existing Key with new data... update row with sysdate as Mod_Date

It`s a simple/common task, I'm hoping there is a simple/common solution that I just don't know yet.

Thanks!
Charles
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

Depending on the size of source and target data, this requirement can be met with multiple designs. For a "reasonable size" of target, see Change Capture and Change Apply stages in Parallel Job Developer's Guide.
simc
Premium Member
Premium Member
Posts: 16
Joined: Wed Jul 22, 2015 12:10 pm

Post by simc »

Awesome, Thank you, that's worked great.

Also, that book is gonna be my bible. I almost want a hard copy!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Maybe you would also like to know that there's a manual called the Parallel Job Advanced Developer's Guide, plus a whole heap of good technical documentation on developerWorks, plus a number of RedBooks dealing with various DataStage topics.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
simc
Premium Member
Premium Member
Posts: 16
Joined: Wed Jul 22, 2015 12:10 pm

Post by simc »

Thanks Ray! I'll look those up too.
Post Reply