Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Using IsInFile
 Login/Join
 
Member
posted
I want to be able to use the 'IsInFile()' function in DQS to determine if a string is found within a file.

Specifically, I have a set of database columns any of which may contain a country name anywhere in the data (for example, it may have a postal code or not in the column. I want to compare that against a list of known country names.

When I attempt to use:
isInFile([Address1], ISO_country_list.txt)
in an AlterFormat, an error appears:
Undefined data source for 'ISO_country_list.txt' at 32-56 in 'isInFile([OriginatorAddress1], ISO_country_list_plus.txt)'.

Function 'isInFile' is not applicable for arguments {STRING, } at 1-8 in 'isInFile([OriginatorAddress1], ISO_country_list.txt)'.

Please advise. I would prefer to not have to parse the string into words, then compare against the country code list (which I can put in a table).

Thank you-
-Kurt

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 3 | Registered: September 25, 2016Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Hi Kurt

Since no one has responded I suggest you open a case with techsupport..


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 1091 | Location: Customer Support | Registered: April 12, 2005Reply With QuoteReport This Post
Member
posted Hide Post
Hi Kurt,
you have to create a lookup file in DQS in order to use the IsInFile function. Following is what the help docs says.

boolean isInFile(string srcStr, string fileName)

Searches for the string srcStr in a file defined by the parameter fileName. The parameter fileName must be a constant expression and must point to a dictionary with simple values. The function returns TRUE if srcStr is found in the dictionary, and FALSE otherwise. Before the search starts, the value of srcStr is trimmed (all whitespaces from the beginning and end of the string are removed) which may possibly lead to NULL value of the search value.

See DQS Tutorial Project Section 04 (Using Lookup) -> 04.05 Lookup functions.plan to see an example

Hope this helps.

Jikku


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: August 05, 2015Reply With QuoteReport This Post
Member
posted Hide Post
Thanks Chuck and Jikku, I have a workaround for the moment, if I encounter challenges, this will help.

Best-
-Kurt


WebFOCUS 8
Windows, All Outputs
 
Posts: 3 | Registered: September 25, 2016Reply With QuoteReport This Post
  Powered by Social Strata  
 


Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.