<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DataFlux 2.6: Compare a field against a list of values from a table in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/518542#M16095</link>
    <description>&lt;P&gt;Hi Vincent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your replay.&lt;/P&gt;&lt;P&gt;I tried your code&amp;nbsp;but unfortunately I got an error massage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25360i7186ABEF7A3DBB02/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen.JPG" alt="Screen.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made some negative-tests and I think my dataconnection is fine and my list has also entries.&lt;/P&gt;&lt;P&gt;Any suggestions what the error caused?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2018 19:42:53 GMT</pubDate>
    <dc:creator>mmerz</dc:creator>
    <dc:date>2018-12-04T19:42:53Z</dc:date>
    <item>
      <title>DataFlux 2.6: Compare a field against a list of values from a table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/517436#M16057</link>
      <description>&lt;P&gt;Hey I’m new to DataFlux Management Studio 2.6 and build so far some data quality controls with the Expression Builder. I use macro variable and the getvar-function to set the value against I compare my dataset. So my control code is fixed and I can still change the values.&lt;/P&gt;&lt;P&gt;Now I have the problem to compare my dataset not only against one value but to list of values. I search a little and found this approach: I insert my comparatives values in a table and try to connect to the database, read the values and then I should compare it with my dataset, but I don’t know how to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have an odbc-connection to my database ClientData and a table dbo.iso3166 with the column iosalpha2 in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So fare from Google-search &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp;I try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;static dbconnection db1
static dbstatement stmt1
dbcursor curs1
boolean retval1

 if isnull(db1) then
   db1 = dbconnect('DSN=ClientData')
if isnull(stmt1) then
begin
   stmt1 = db1.prepare("SELECT ISOALPHA2 FROM dbo.iso3166 WHERE ISALPHA IS NOT NULL")
   stmt1.setparaminfo(0, 'string', 5)
end

 
&amp;lt;&amp;lt;missing comparison&amp;gt;&amp;gt;

 
 
if retval1 == true then
return true
else
return false&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any suggestion how I can fill the missing comparison-section to realize a comparsion between my dataset field "countrycode" and the values from my&amp;nbsp;column isoalpha2?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm thankful for any help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 12:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/517436#M16057</guid>
      <dc:creator>mmerz</dc:creator>
      <dc:date>2018-11-30T12:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: DataFlux 2.6: Compare a field against a list of values from a table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/518159#M16086</link>
      <description>&lt;P&gt;Hi Matthias&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you run this code into a data quality control, it means that you will execute a sql query for each check.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The built in test 'Compare a field to a field in a datasource' generates the code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;static dbconnection db1
static dbstatement stmt1
dbcursor curs1
boolean retval1

if isnull(db1) then
   db1 = dbconnect('DSN=ClienData')

if isnull(stmt1) then
begin
   stmt1 = db1.prepare('SELECT ISOALPHA2 FROM dbo.iso3166 WHERE ISALPHA IS NOT NULL AND ISOALPHA2 = ? ')
   stmt1.setparaminfo(0, 'string', 255)
end&lt;BR /&gt;// you will need a field 'ISOALPHA2'
stmt1.setparameter(0, ISOALPHA2)
curs1 = stmt1.select()
retval1 = curs1.next()
curs1.release()
&lt;BR /&gt;//if the input code is not in the list then we generate a trigger
if retval1 == false then
   return true
else
   return false&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 17:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/518159#M16086</guid>
      <dc:creator>VincentRejany</dc:creator>
      <dc:date>2018-12-03T17:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: DataFlux 2.6: Compare a field against a list of values from a table</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/518542#M16095</link>
      <description>&lt;P&gt;Hi Vincent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your replay.&lt;/P&gt;&lt;P&gt;I tried your code&amp;nbsp;but unfortunately I got an error massage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25360i7186ABEF7A3DBB02/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen.JPG" alt="Screen.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made some negative-tests and I think my dataconnection is fine and my list has also entries.&lt;/P&gt;&lt;P&gt;Any suggestions what the error caused?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 19:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DataFlux-2-6-Compare-a-field-against-a-list-of-values-from-a/m-p/518542#M16095</guid>
      <dc:creator>mmerz</dc:creator>
      <dc:date>2018-12-04T19:42:53Z</dc:date>
    </item>
  </channel>
</rss>

