Page 1 of 1

how implement like operator in DS

Posted: Sat Jan 16, 2010 8:46 am
by pradeep_nov18
Hi All,

I have requirement where i have to do If Input.Column like 'INT%' then Column else Other Column.

Please help out in solving.

Thanks in advance,

Regards,
Pradeep

Posted: Sat Jan 16, 2010 8:50 am
by chulett
Use the substring operators to check to see if the first three characters = "INT". For example:

Code: Select all

If Link.Column[1,3] = "INT" then this else that

Posted: Sat Jan 16, 2010 8:57 am
by pradeep_nov18
chulett wrote:Use the substring operators to check to see if the first three characters = "INT". For example:

Code: Select all

If Link.Column[1,3] = "INT" then this else that
...

Hi Chulett,

Thanks For the Reply.

But Then part will be performed only if it "INT",Even imay get like INT1,INT2 etc Then this condition will fail.

So i want implement "ORACLE LIKE OPERATOR IN DATASTAGE".

Thanks,
Pradeep.V

Posted: Sat Jan 16, 2010 9:16 am
by chulett
Which is exactly what I gave you does. How will checking the first three characters of "INT1" or "INT2" for "INT" fail? :?

Posted: Sat Jan 16, 2010 9:23 am
by pradeep_nov18
chulett wrote:Which is exactly what I gave you does. How will checking the first three characters of "INT1" or "INT2" for "INT" fail? :? ...

Hi Chulett,

I want to populate If Input.Column = 'INT%' Then column else 0.hence i want to know how achieve wild card '%' in datastage.

Thanks for your response,

Posted: Sat Jan 16, 2010 9:37 am
by chulett
Stop and think about it for a moment. Maybe even try it. The code I gave you does exactly that. And now that I know the this and that:

Code: Select all

If Link.Column[1,3] = "INT" then Link.Column else "0"

Posted: Mon Jan 18, 2010 8:16 am
by nagarjuna
In Filter stage you can use like operator ...But i dont know how far you can use it in your requirement ..

Posted: Mon Jan 18, 2010 4:47 pm
by jhmckeever
... or if you're averse to Craig's straightforward solution, or your requirements become more complex, then you could always use <a href="viewtopic.php?t=107882">regular expressions</a>

John.