<?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: PROC SQL scan function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/331022#M74345</link>
    <description>&lt;P&gt;I came up with below code , thought of sharing with you all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your suggestions. I really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;BR /&gt;select files into :filename1 separated by '~'&lt;BR /&gt;from &amp;amp;SUMMAR where scan(files,1,' ') like '%no%';&lt;BR /&gt;%LET FILE_COUNT1=&amp;amp;sqlobs;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;BR /&gt;select files into :filename2 separated by '~'&lt;BR /&gt;from &amp;amp;SUMMAR where scan(files,1,' ') not like '%no%';&lt;BR /&gt;%LET FILE_COUNT2=&amp;amp;sqlobs;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2017 22:51:10 GMT</pubDate>
    <dc:creator>SASAna</dc:creator>
    <dc:date>2017-02-08T22:51:10Z</dc:date>
    <item>
      <title>PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330628#M74215</link>
      <description>&lt;P&gt;Need help with the below question.&amp;nbsp;&lt;SPAN&gt;scan(files,1,' ') ^= 'No' is not working. &amp;amp; all are going to filename1.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;some files have 'No records found' &amp;amp; wanted this to go to filename2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%Macro test(SUMMAR= );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;BR /&gt;select files into :filename1 separated by '~'&lt;BR /&gt;from &amp;amp;SUMMAR where scan(files,1,' ') ^= 'No' ;&lt;BR /&gt;%LET FILE_COUNT1=&amp;amp;sqlobs;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;BR /&gt;select files into :filename2 separated by '~'&lt;BR /&gt;from &amp;amp;SUMMAR where scan(files,1,' ') = 'No' ;&lt;BR /&gt;%LET FILE_COUNT2=&amp;amp;sqlobs;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code continues...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MEND;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 21:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330628#M74215</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2017-02-07T21:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330629#M74216</link>
      <description>&lt;P&gt;Comparisons are case sensitive and you could have a trailing space perhaps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check what the SCAN function is returing directly with a PUT statement or data step and then compare that to your criteria.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 21:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330629#M74216</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-07T21:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330660#M74225</link>
      <description>&lt;P&gt;Show some actual data.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 23:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330660#M74225</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-07T23:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330698#M74246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is bunch of files and some of them will be like 'No records'. &amp;nbsp;I want to identify them by splitting them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 03:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330698#M74246</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2017-02-08T03:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330700#M74247</link>
      <description>&lt;P&gt;Try to see the content of that first word with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL ;
select 
	files, 
	scan(files, 1, ' ') as firstWord format=$8.,
	scan(files, 1, ' ') as firstWordHex format=$hex16.
from &amp;amp;SUMMAR;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Feb 2017 03:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330700#M74247</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-02-08T03:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330701#M74248</link>
      <description>&lt;P&gt;Your query is using a table. What does that table look like?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 03:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/330701#M74248</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-08T03:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/331022#M74345</link>
      <description>&lt;P&gt;I came up with below code , thought of sharing with you all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your suggestions. I really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;BR /&gt;select files into :filename1 separated by '~'&lt;BR /&gt;from &amp;amp;SUMMAR where scan(files,1,' ') like '%no%';&lt;BR /&gt;%LET FILE_COUNT1=&amp;amp;sqlobs;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;BR /&gt;select files into :filename2 separated by '~'&lt;BR /&gt;from &amp;amp;SUMMAR where scan(files,1,' ') not like '%no%';&lt;BR /&gt;%LET FILE_COUNT2=&amp;amp;sqlobs;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 22:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-scan-function/m-p/331022#M74345</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2017-02-08T22:51:10Z</dc:date>
    </item>
  </channel>
</rss>

