Detecting New Records

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
endyl13
Premium Member
Premium Member
Posts: 44
Joined: Tue Jun 25, 2002 12:47 am
Location: Qatar
Contact:

Detecting New Records

Post by endyl13 »

Hi,

I'm new to DataStage.
I'm trying to detect the new records that coming from one data source.
I have file A with key DSA_ID. I have table B which consist all the records with unique key that exist in the system, the key is also DSA_ID.

I try to use transformer stage to do this, but the problem is that i have to have 2 outputs. The first one with Constraint
'TabelA.DSA_ID Matches LookUpHashedB.DSA_ID'
and the second output with 'Reject Row' ticked.

How can I do this with only one output? I've tried to do using constraint :
'TabelA.DSA_ID <> LookUpHashedB.DSA_ID'
but it didn't work.

DSA_ID data type is VarChar(6)

Thanks in advance...
Endy


Regards

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

Post by ray.wurlod »

I am basing this answer on the following understanding of your question: you want to process only those records from FileA that do not also occur (based on key) on FileB.

FileA feeds a Transformer stage on the main input link.
FileB feeds the same Transformer stage on a reference input link.
The Reference Key Expression for FileB is FileA.KeyColumn

On the single output link from the Transformer stage, the constraint expression can consist solely of the Link Variable FileB.NOTFOUND (choose Link Variables in the Expression Editor's drop down list of operands).

An alternative constraint expression would be IsNull(FileB.KeyColumn) which relies on DataStage setting all columns on a reference input link to NULL when the row sought is not found.
endyl13
Premium Member
Premium Member
Posts: 44
Joined: Tue Jun 25, 2002 12:47 am
Location: Qatar
Contact:

Post by endyl13 »

Thank you very much Ray...
I'm using the Link Variables, seems like easier :-)

Thanks again

Regards

ND
Post Reply