Page 1 of 1

Datastage server 7.5 like function

Posted: Mon Feb 21, 2011 9:22 am
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%).

Posted: Mon Feb 21, 2011 9:37 am
by vinothkumar
Try with Index function

Posted: Mon Feb 21, 2011 9:37 am
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.

Posted: Mon Feb 21, 2011 9:58 am
by DSguru2B
You can try the Matches operator as well.

Posted: Tue Feb 22, 2011 5:07 am
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"

Posted: Tue Feb 22, 2011 7:51 am
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"