I'm definitely not firing on all cylinders today and need a little clarification. I've searched the forum - but can't find anything that directly addresses my current issue- so here it is:
I have a hashed file with Customer_Number as my key field.
I also have an input file with multiple columns - including My_Customer_Number, Your_Customer_Number, and Our_Customer_Number.
Retvalue=""
Open "suresh" to myfile else ABORT
Readu Retvalue from myfile, Arg1 else
Readu Retvalue from myfile, Arg2 else
Readu Retvalue from myfile, Arg3 else
Retvalue = -1
End
End
End
Ans = Retvalue
Its very raw right now. You need to add error handling. This is just to give an idea.
Last edited by DSguru2B on Mon Feb 05, 2007 3:49 pm, edited 1 time in total.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
You can have three reference links coming into the transformer from same the hashed file look-up.
One each for performing the lookup based on the three incoming fields.
HTH,
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
X, Y, P, Q, A and C were just examples that there was more code to my second output file and I could therefore not simply use the "Reject Row" option. Really insignificant here.
On to the more important stuff.
If I'm reading your code correctly, this would search my hashed file for the three possible values in the input file, and if not found would return basically a LookUpFile.NOTFOUND value. Correct?
Thanks Whale -
that is actually how we currently have our process set up - but for some reason someone doesn't like that design and tasked me with making this work with only one link coming into the transformer.
jjrbikes wrote:
If I'm reading your code correctly, this would search my hashed file for the three possible values in the input file, and if not found would return basically a LookUpFile.NOTFOUND value. Correct?
It will return a -1 if the value is not found. You can leverage that for LookUpFile.NOTFOUND
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
are you carrying these three source fields to target or are you carrying only the reference lookup (field ) to the target ? or not carrying any of these fields to the target only using them for selection of the data??
jjrbikes wrote:that is actually how we currently have our process set up - but for some reason someone doesn't like that design
But Why? May I know the reason?
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
If X Then My_Customer_Number Else If Y Then Your_Customer_Number Else Our_Customer_Number
If you want to look up all three you must use three reference links. Then it's a matter of checking the results in whatever dependancy order you may have.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Whale -
The only explanation provided was that it was "messy, hard to follow and even more difficult to debug and maintain". But, now I know for sure that this is truly the best, if not the only, way to write this piece of code.
hi,
if I have trouble about expressions like that, I do one variable for each TRUE expression, and then it's very easy to debug,
vars :
true_1 : if NOT(LookUpFile.NOTFOUND) then @true else @false
true_2 : X <> Y or P <> Q or A <> C then @true else @false
derivation :
true_1 AND true_2
and then your not_easy_someone will be happy to see that your work is so easy to debug