Datastage server 7.5 like function

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sandeepch19
Participant
Posts: 36
Joined: Fri May 21, 2010 12:40 am
Location: Bangalore

Datastage server 7.5 like function

Post by Sandeepch19 »

do we have a like function or similar type of function in Datastage 7.5 server edition. We have values A.12,A.12-1 but we might get other values in the future(like A.12-3). I am in need of some function which can take the values in this way(A.12%).
Sandeep Chandrashekar
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Try with Index function
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

For that you could just check the first 4 characters using the substring [] operator. For a check inside the string, investigate the Index() function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can try the Matches operator as well.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no Like operator or function in version 7.5. There is, however, a Matches operator. This uses DataStage BASIC pattern matching, in which either "..." or "0X" is the general wildcard. So a suitable expression for your stated requirement would be

Code: Select all

InLink.TheField Matches "'A.12'0X"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why over-complicate it? As noted, you can "match" the first four characters of the string like so:

Code: Select all

YourField[1,4] = "A.12"
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply