Lookup Column Derivation

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
NEO
Premium Member
Premium Member
Posts: 163
Joined: Mon Mar 22, 2004 5:49 pm

Lookup Column Derivation

Post by NEO »

I have 3 different hash files coming from three different tables with 2 columns in which one is the key column . I have to populate the values of these two columns with two of the new columns present in my target sequential file.

I am doing the lookup on the key with my database. But all my data should be from hashfiles only. It should not take the column value from my database.

First Column derivation should be

IF no rows found in hash1 then look in hash2 and if no rows found in both hash1 and hash2 then take the hash3 ( I have to populate with column1 value in the hash file)

Second column also should be the same

IF no rows found in hash1 then look in hash2 and if no rows found in both hash1 and hash2 then take the hash3 ( I have to populate with column2 value in the hash file)

thanks
denzilsyb
Participant
Posts: 186
Joined: Mon Sep 22, 2003 7:38 am
Location: South Africa
Contact:

Post by denzilsyb »

Hallo Neo

I have the DB link as my stream input and the hash files as reference to the transformer.

This is my code for your first column derivation:

Code: Select all

if ( HASH1.NOTFOUND and 
   HASH2.NOTFOUND ) then HASH3.colA else 
if HASH1.NOTFOUND then HASH2.colA else 
   HASH1.colA
it might spark some brilliance on your side :D
dnzl
"what the thinker thinks, the prover proves" - Robert Anton Wilson
NEO
Premium Member
Premium Member
Posts: 163
Joined: Mon Mar 22, 2004 5:49 pm

Post by NEO »

I guess that helps.Is it possible to say if I find a blank make it to null in the target column

thanks
Post Reply