Page 1 of 1

lookup operator.

Posted: Thu Sep 23, 2004 10:50 pm
by srikanthd1978
..hi.

.. lets say we have the following requirement...

..there is a decimal field in ur CFD (u r reading from a Mainframe file) say X..and in ur job u perform a lookup where one of the reference links is from a LkpFileset..now what u have to do is .. when the lookup is successfull, u need to get the value of X from the refernce link, and when the lookup is unsuccessfull then u want a default value to be present for our clmn X..How do u accomplish this witout using the Transformer....the operators that i am uing are .. primary source : datset, reference source : LkpFileset, and a lookup operator..target: datset.

all inputs are welcome..

now in a server job ur reference source is a hash file and in ur Xfmer.. u specify If LookUp Found do this else do that.. how do u get the same funcationalty in PX..

sorry for the length of the msg..but i hope u got my point..


thanks,
srikanth.

Posted: Fri Sep 24, 2004 3:49 am
by richdhan
Hi Srikanth,

In the lookup stage you have 4 options if the lookup is not found. The options are 1. Continue 2. Abort 3. Reject and 4. Drop. I hope if you use the first option and say to continue a null will be passed to the output. Then you can pass the output to the modify stage and do the null handling to update with the default value.

HTH
--Rich

Pride comes before a fall
Humility comes before honour

Posted: Fri Sep 24, 2004 7:15 am
by srikanthd1978
rich..

.. i have observed that the lookup stage does not throw out a null when the lookup is not found, it just passes an empty string with the Continue option in the lookup stage.....Now we will be looking at a function that converts an EmptyString to NULL..i am not sure weather we have this...

Thanks,
srikanth.

Posted: Fri Oct 01, 2004 2:00 pm
by RobertScarbrough
S,

I have coded a lookup stage with several reference links and was able to check for null values on downstream in a transform successfully when a value was not found. I think one of the tricks is that the source value must be nullable (not really sure why) and the target must be nullable (this makes total sense). Try working with those settings and see if it works.

-rls