BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Want to sponsor BOB? 
Want to sponsor BOB? (Opens a new window)  

General Notice: Upcoming Events: PGHBOUG: Oct 19.

Information Steward Rule - Find Substring in String


 
Search this topic... | Search DI: Information Steward... | Search Box
Register or Login to Post    Forum Index -> Data Integrator -> DI: Information Steward  Previous TopicPrint TopicNext Topic
Author Message
dsewardj
Forum Member
Forum Member



Joined: 22 Oct 2012

Posts: 8



PostPosted: Thu Aug 06, 2015 11:56 am 
Post subject: Information Steward Rule - Find Substring in String

My requirement is simple and I am shocked Information Steward does not seem to support this functionality.

Essentially I am trying to determine if a string contains a substring, and if it does, I want to flag this as an error.

So for instance, the whole string I am checking is 'abcdefg'. If this string contains the substring 'cd' then I want to flag this as an error.

I have tried to use the match regular expression function but it does not work. Does anyone have any insight?
Back to top
riegjul
Forum Member
Forum Member



Joined: 24 May 2018

Posts: 1



PostPosted: Thu May 24, 2018 5:15 am 
Post subject: Re: Information Steward Rule - Find Substring in String

Has anybody found a solution to this "easy" requirement yet?

I cannot find a way to find a substring defined in a variable within a given input.
i.e:

$searchstring - variable of type varchar where substring is located
$input - Input string which should be checked wheter it contains the variable $searchstring.

Any help would be greatly appreciated
Back to top
jlynn73
Forum Associate
Forum Associate



Joined: 27 Oct 2009

Posts: 545
Location: DesMoines Iowa


flag
PostPosted: Thu May 24, 2018 6:54 am 
Post subject: Re: Information Steward Rule - Find Substring in String

I imagine theres half a dozen different ways to do this, including using regular expressions. I typically use the index() function. It returns the starting position of the substring field if present. (check if index > 0)

of note... if you're trying to raise an exception, DS doesnt seem to like having the raise_exception inside of an ifthenelse statement. I believe the optimizer must garbage collect the field and you get nothing on output. So my suggestion is to wrap a custom function around it.
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Data Integrator -> DI: Information Steward  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0291 seconds using 17 queries. (SQL 0.0024 Parse 0.0009 Other 0.0259)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo