<?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 SAS Data Integration Filter with SCAN Function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387024#M92747</link>
    <description>&lt;P&gt;I'm trying to filter out certain elements within a field e.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name:&lt;/P&gt;&lt;P&gt;Marcus, Halberstream&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where "Name" is the field and "Marchus, Halberstream" is an individual record&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using SCAN in the filter&amp;amp;sort section of "Create Table" in SAS DI in the following manner:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCAN(Name,2,',')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It correctly returns "Halberstream" - the string I want to filter by - but when I put the logic in and run the table, I still see "Marcus, Halberstream" in the output table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on what I may be doing wrong or a better solution? I thought about using SUBSTR except the records are of different length, and so I cannot set an arbitrary element start-stop location, but must use "," delimiter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Soules9219&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 14:35:57 GMT</pubDate>
    <dc:creator>soules9219</dc:creator>
    <dc:date>2017-08-10T14:35:57Z</dc:date>
    <item>
      <title>SAS Data Integration Filter with SCAN Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387024#M92747</link>
      <description>&lt;P&gt;I'm trying to filter out certain elements within a field e.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name:&lt;/P&gt;&lt;P&gt;Marcus, Halberstream&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where "Name" is the field and "Marchus, Halberstream" is an individual record&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using SCAN in the filter&amp;amp;sort section of "Create Table" in SAS DI in the following manner:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCAN(Name,2,',')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It correctly returns "Halberstream" - the string I want to filter by - but when I put the logic in and run the table, I still see "Marcus, Halberstream" in the output table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on what I may be doing wrong or a better solution? I thought about using SUBSTR except the records are of different length, and so I cannot set an arbitrary element start-stop location, but must use "," delimiter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Soules9219&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 14:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387024#M92747</guid>
      <dc:creator>soules9219</dc:creator>
      <dc:date>2017-08-10T14:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration Filter with SCAN Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387031#M92751</link>
      <description>&lt;P&gt;First I do not use or have access to DI, and possibly this question belongs in the Data Management as that is where DI goes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that, I would not expect Filter to change the actual values of anything. I would expect it to reduce a set to those values I specified.&lt;/P&gt;
&lt;P&gt;Perhaps you are looking for a task to create a new variable based on an existing one?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 14:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387031#M92751</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-10T14:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration Filter with SCAN Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387035#M92754</link>
      <description>&lt;P&gt;That's right, I am not trying to change or remove anything, just reduce the set by my filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&amp;nbsp;for example if if i have 600 records in my set, after the SCAN filter function, I still have 600 whereas it should be lower.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 14:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387035#M92754</guid>
      <dc:creator>soules9219</dc:creator>
      <dc:date>2017-08-10T14:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration Filter with SCAN Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387082#M92770</link>
      <description>&lt;P&gt;Are you wanting to exclude or include the given name? It sounds like exclude but I'm not sure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would expect a filter to let me do something like Scan(name,2,',') = 'Smith' to select or Scan(name,2,',') ne 'Smith' to exclude. Perhaps you didn't get to the&amp;nbsp;part to indicate exclude. Or perhaps your comparison string is incorrect. In Base sas&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;scan(&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;"Marcus, Halberstream"&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;2&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;','&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;yields "&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;&amp;nbsp;Halberstream", with a leading blank. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;The default&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;scan(&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;"Marcus, Halberstream"&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;2&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;) will treat the blank as a delimiter as well and the leadingblank is not in the result.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 16:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387082#M92770</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-10T16:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration Filter with SCAN Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387099#M92778</link>
      <description>&lt;P&gt;Thanks that worked,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could not see that it was entering a leading space on my end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 17:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387099#M92778</guid>
      <dc:creator>soules9219</dc:creator>
      <dc:date>2017-08-10T17:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration Filter with SCAN Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387115#M92789</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/155891"&gt;@soules9219&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks that worked,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could not see that it was entering a leading space on my end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The proportional fonts I believe are used in most of the table viewers can make a leading blank very skinny and only having had such issues before made me think of that as an option.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 18:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Data-Integration-Filter-with-SCAN-Function/m-p/387115#M92789</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-10T18:01:02Z</dc:date>
    </item>
  </channel>
</rss>

