Page 1 of 1

using NOT LIKE in transformation

Posted: Mon Jul 27, 2009 7:08 pm
by today
Hi,

When I am using NOT LIKE in a transformation, DS is throwing error : error compiling sub routine for stage.

If there any other function for accomplish following task:

IF DRS_PS_D_PRJ.PROJECT_ID LIKE '8%' Then 'Y' Else 'N'

Thanks

Posted: Mon Jul 27, 2009 7:25 pm
by ray.wurlod
NOT LIKE is not supported. That's SQL. You can use NOT LIKE in a Filter stage.

In a Transformer stage, you must build an expression using Not() function and Matches operator. Or you can test the first character of the string as an explicit character value.

Posted: Mon Jul 27, 2009 7:54 pm
by keshav0307
IF DRS_PS_D_PRJ.PROJECT_ID LIKE '8%' Then 'Y' Else 'N'
can be
IF LEFT(DRS_PS_D_PRJ.PROJECT_ID,1)='8' Then 'Y' Else 'N'

-----------

IF DRS_PS_D_PRJ.PROJECT_ID NOT LIKE '8%' Then 'Y' Else 'N'
can be
IF LEFT(DRS_PS_D_PRJ.PROJECT_ID,1)<>'8' Then 'Y' Else 'N'

Posted: Tue Jul 28, 2009 8:27 am
by today
Thanks Keshav,

It worked liked a charm

Really appreciate your help.