Type 2 question

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
marc_brown98
Premium Member
Premium Member
Posts: 67
Joined: Wed Apr 14, 2004 11:33 am

Type 2 question

Post by marc_brown98 »

I have a server job that checks for type 2 scd, if any of the fields have changed via crc32(all fields concatenated) I either update(expire) an existing record and write a new version of the expired record or it is a new record and is an insert only. Problem that I have is that sometimes the update existing/expire process does not complete before the job tries to insert the new dimension record and the insert fails because of a unique constraint on the natural key and the expire date. Any suggestions, short of splitting the server into 2?

Thanks
Marc
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Re: Type 2 question

Post by ogmios »

If you land your data to a file e.g. you can never have this.

Ogmios
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Split your type 2 data into two streams one for existing update and another one for new inserts. Send this as Sequential File and in the next job use the file to update the existing records first and then use the separate job to insert new records you will never have this problem.

Thanks
Rasi
Post Reply