using NOT LIKE in transformation

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
today
Participant
Posts: 24
Joined: Wed Jan 14, 2009 9:59 pm

using NOT LIKE in transformation

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post 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'
today
Participant
Posts: 24
Joined: Wed Jan 14, 2009 9:59 pm

Post by today »

Thanks Keshav,

It worked liked a charm

Really appreciate your help.
Post Reply