Page 1 of 1

Like Operator in Transform

Posted: Tue Feb 28, 2006 3:11 pm
by rxs0005
hi all

the logic is like this

BALLOON_INDICATOR = 'Y' if PRODUCT_TYPE like '%alloon%'

I have translated it to the below in the Transformer it does not seem to work

If tpo_loan_orig_out.PRODUCT_DESCRIPTION Matches "%alloo%" Then "Y" Else "N"

i also tried

If tpo_loan_orig_out.PRODUCT_DESCRIPTION Matches "alloo" Then "Y" Else "N"

how do i do this logic


basically i need an equivalent to the LIKE operator in ORacle

thanks

rxs0005

Re: Like Operator in Transform

Posted: Tue Feb 28, 2006 3:28 pm
by rwierdsm
Why don't you try:

if Index (tpo_loan_orig_out.PRODUCT_DESCRIPTION , 'alloo', 1) > 0 then 'Y' else 'N'

Rob Wierdsma

Posted: Tue Feb 28, 2006 4:11 pm
by DSguru2B
Here, try this. It works for me. I bet it will work for you

If trim(tpo_loan_orig_out.PRODUCT_DESCRIPTION) Matches "...alloo..." Then "Y" Else "N"

Posted: Tue Feb 28, 2006 4:32 pm
by ray.wurlod
DataStage server job expressions do not use SQL wildcards. DataStage server job expressions have a more flexible set of pattern matching capabilities which you can read about in on line Help (topic Pattern Matching Operators) or in the DataStage BASIC manual.

Posted: Wed Mar 01, 2006 8:57 am
by rxs0005
DSguru2B

that worked !!

thanks!!

rxs0005