<?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: %let and Scan Function! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40633#M8291</link>
    <description>If you have a standardized character string format, you can generalize your code to %INDEXC the first occurence of "_" and then %SUBSTR from there.  The use of SCAN is incorrect as you have described in your posted code, by the way.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 03 Jun 2009 15:06:35 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-06-03T15:06:35Z</dc:date>
    <item>
      <title>%let and Scan Function!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40632#M8290</link>
      <description>%let dat=Abc_2009_05;&lt;BR /&gt;
%let date=scan("&amp;amp;dat",2,'_')||'_'||scan("&amp;amp;dat",3,'_');&lt;BR /&gt;
&lt;BR /&gt;
What is to be done to make &amp;amp;date to resolve to 2009_05?</description>
      <pubDate>Wed, 03 Jun 2009 14:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40632#M8290</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-06-03T14:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: %let and Scan Function!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40633#M8291</link>
      <description>If you have a standardized character string format, you can generalize your code to %INDEXC the first occurence of "_" and then %SUBSTR from there.  The use of SCAN is incorrect as you have described in your posted code, by the way.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 03 Jun 2009 15:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40633#M8291</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-06-03T15:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: %let and Scan Function!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40634#M8292</link>
      <description>Hi Scott,&lt;BR /&gt;
 I tried this and it worked:&lt;BR /&gt;
%let date=%scan(&amp;amp;dat,2,'_')_%scan(&amp;amp;dat,3,'_');</description>
      <pubDate>Wed, 03 Jun 2009 15:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40634#M8292</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-06-03T15:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: %let and Scan Function!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40635#M8293</link>
      <description>It should be [pre]&lt;BR /&gt;
%let date=%scan(&amp;amp;dat,2,_)_%scan(&amp;amp;dat,3,_); [/pre]&lt;BR /&gt;
You are using ' as delimiters in your example, which you don't need or mean to.</description>
      <pubDate>Thu, 04 Jun 2009 03:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/let-and-Scan-Function/m-p/40635#M8293</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-06-04T03:22:20Z</dc:date>
    </item>
  </channel>
</rss>

