<?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: Else statement in proc import macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432904#M107269</link>
    <description>&lt;P&gt;Check SAS 9.4 macro appendix for a macro that shows how this can be executed, where empty data set gets an empty record. There example is for export but I think you’ll get the idea.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2018 20:45:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-01-31T20:45:07Z</dc:date>
    <item>
      <title>Else statement in proc import macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432870#M107256</link>
      <description>&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DorsHHFPath =/dorsshare/HHFit;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;DorsHHFPath;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; StateList=ga il in ky md mi;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; fetchstate(Statelist= ,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currdate= );&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; cnt=1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Thisstate=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%scan&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;StateList, &amp;amp;cnt, &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Str&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;( ) );&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Do&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%While&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&amp;amp;Thisstate NE );&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import out= &amp;amp;Thisstate&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; datafile=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;DorsHHFPath/&amp;amp;Thisstate./&amp;amp;Thisstate._HHF_STM_ToState_&amp;amp;CURRDATE_KEY._01.csv"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dbms=CSV replace ;&lt;/P&gt;
&lt;P&gt;getnames=no;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; datarow=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/*** Advance counter and select next state ***/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; cnt=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%eval&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;cnt + 1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Thisstate=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%scan&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;StateList, &amp;amp;cnt, &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Str&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;( ) ); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%End&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%Mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;fetchstate&lt;/I&gt;&lt;/STRONG&gt;(StateList=&amp;amp;StateList,&lt;/P&gt;
&lt;P&gt;Currdate=&amp;amp;Currdate);&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080" face="Courier New"&gt;&amp;amp;CURRDATE_KEY represents todays date.&amp;nbsp; This macro script creates a work file if the date extention is todays date.&amp;nbsp; If not the script generates an error.&amp;nbsp; Is there a way to avoid the error with some type of else statement that says 'no file' ??&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 19:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432870#M107256</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2018-01-31T19:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Else statement in proc import macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432877#M107259</link>
      <description>&lt;P&gt;Use the fexist() function.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 19:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432877#M107259</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-31T19:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Else statement in proc import macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432904#M107269</link>
      <description>&lt;P&gt;Check SAS 9.4 macro appendix for a macro that shows how this can be executed, where empty data set gets an empty record. There example is for export but I think you’ll get the idea.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 20:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Else-statement-in-proc-import-macro/m-p/432904#M107269</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-31T20:45:07Z</dc:date>
    </item>
  </channel>
</rss>

