how implement like operator in DS
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 92
- Joined: Wed Mar 05, 2008 4:09 am
- Location: chennai
- Contact:
how implement like operator in DS
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
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
pradeep.v
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
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 92
- Joined: Wed Mar 05, 2008 4:09 am
- Location: chennai
- Contact:
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
pradeep.v
-
- Participant
- Posts: 92
- Joined: Wed Mar 05, 2008 4:09 am
- Location: chennai
- Contact:
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,
pradeep.v
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"
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
... 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.
John.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>