Hi,
Could anyone help me find a datastage function equivalent to like operator in sql '%PO BOX%'.
requirement:
the address column may have PO BOX in the string (length=80) and may be populated in any place (position in the string). all i need to do is to find if the string has PO BOX poplutaed or not.
example 1: "PMB 245 PO BOX 2020"
example 2: "404 WESTERN AVENUE"
example 3: "HI PO BOX 123 XYZ123"
DS function should say 1 for example 1
DS function should say 0 for example 2
DS function should say 1 for example 3
Thanks and Regards,
rl
find PO BOX in a string
Moderators: chulett, rschirm, roy
Just try this...I haven't try my hands on this.
Code: Select all
If Count(Column_name,'PO BOX') > 0 Then 1 Else 0-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The Index() function is the one you want.
or you might add other variations
Code: Select all
(Index(InLink.TheString, "PO BOX", 1) > 0)Code: Select all
(Index(InLink.TheString, "PO BOX", 1) > 0) Or (Index(InLink.TheString, "POBOX", 1) > 0)IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.