check if substring in a routine

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
ysrinu
Participant
Posts: 18
Joined: Fri Aug 24, 2007 4:46 pm

check if substring in a routine

Post by ysrinu »

Hi in a BASIC routine,
i can use the FIELD function to extract a substring from a string based on delimiters and instances

How can i check if a string S1 is a substring of S2 or not? The substring can occur at any part of S1

Thanks,
-srinivas yelamanchili
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

How about using Index Function??
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

You can write your own C++ routine to emulate your requirement.
Birendra
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No need to write anything for Server when all kinds of functionality is already built in. As noted, 'Index' is a good answer here and the returned found position of the substring can be treated as a simple true/false Boolean when just checking for existence.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ysrinu
Participant
Posts: 18
Joined: Fri Aug 24, 2007 4:46 pm

Post by ysrinu »

INDEX works, thanks to all !
Post Reply