writing data into two different tables

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
adams06
Participant
Posts: 92
Joined: Sun Mar 12, 2006 3:00 pm

writing data into two different tables

Post by adams06 »

I have two tables

1st one is main source, i have a field x in that.
2nd one is a look up , i have a field y in that.

Both the datatype and length are equal.

my 1st problem is, if the record exist in x, and if the same record exist in y then i need to write to write to a flat file .how to implement this condition.

my 2nd problem is, if the record exist in x, and does not record exist in y ,then i need to write in another flat file, how to implement this condition.


thanks in advance
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Ok..You have a mainsource..then a Transformer and a reference input(hashed file). Now as per your design you will have two outputs from your Transfomer to two flat files. In the Constraints section of the Transformer, go to LinkVariables, Input NOTFOUND and set it such that..

Input.NOTFOUND<>@TRUE for your first problem and
Input.NOTFOUND=@TRUE for your second problem.

And ofcourse, I am assuming you are having a common key between your main source and the hashed file.

IHTH

Kris.
Post Reply