Save doublon

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

DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

DSguru2B wrote:If you get any key violation, the warning will be created. Thats why you need to explicitly handle it by the method devised, and capture the duplicates in a seperate file. This way you dont send any duplicates.
Says who. I did, right there :P

thurmy34:
Go to Sequential file stage, go to properties, on the general tab, check the box that says 'Stage uses filter commands', then switch to the outputs tab there you will find the Filter Command Box active. You can specify OS level commands there.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
shrek7577
Participant
Posts: 62
Joined: Thu Sep 28, 2006 6:53 am
Location: France, Paris

Post by shrek7577 »

Yes, I use this constraints :

Doublon file:
(table.REJECTED and table.DBMSCODE = 'ORA-00001' )

Filter file :
(table.REJECTED and table.DBMSCODE <> 'ORA-00001' )

So i can catch every error from table.
But, DS generate some also warning in the log (in Director).
Here, some routine use this to generate log synthesis and BUG, every warning will stop the global batch...

Unfortunately, I can't modify the framework but have permissionto skip the table warning (the batch must go on and all the warnings will be treated later)

:idea:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't want to catch every error, you want to avoid generating any errors. There's no reason on the planet for a Server job to ever generate any warnings. You should be checking for uniqueness before sending anything to your database and either turning that operation into an update or logically discarding the record via your constraints - not putting the burden on your DB and then catching anything it pukes back up. :P

This is perfectly 'normal' ETL processing and is easily accomplished with hashed file lookups leveraging the natural keys in your input data compared to your target.
-craig

"You can never have too many knives" -- Logan Nine Fingers
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

It was right in front of me

Sorry for his useless post.

Thank You DSguru2B.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The following design will help. HashedFileStage1 and HashedFileStage2 refer to the same hashed file.

Code: Select all

           HashedFileStage1   HashedFileStage2
                       |              ^
                       |              |(not found)
                       V              |
              ----->   TransformerStage  ------------> SequentialFile
                                            (found)
The hashed file will contain the first occurrence of each key value, the sequential file will contain all the duplicates. In HashedFileStage1 set read cache to "disabled, lock for updates" and in HashedFileStage2 do not enable write cache.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepak.shanthamurthy
Participant
Posts: 17
Joined: Tue Apr 11, 2006 2:35 pm

Post by deepak.shanthamurthy »

Hi
am trying to capture duplicate records
i have sorted the records on the key
and am using the following code as stage variables.

Var = Key
flag = If Var = Var2 Then "Duplicate" Esle "NO"
Var2 = Var

But this is not giving me the results

Though i see in my debugger that var2 is retaining the old value of var the flag is always being set to Duplicate!!!!!

not sure where the problem is ???

Any help is appreciated

Thanks
Deepak
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

You cannot hijack a thread like this. You need to start a new thread/post.

Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
deepak.shanthamurthy
Participant
Posts: 17
Joined: Tue Apr 11, 2006 2:35 pm

Post by deepak.shanthamurthy »

sorry for that...
starting this as a new thread....
Deepak
Post Reply