<?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 Macro / Filename CSV in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722212#M223906</link>
    <description>&lt;P&gt;I have the following simple macro&lt;/P&gt;&lt;P&gt;%macro hospseq (DSN=,NDSN=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data new2019; set &amp;amp;DSN; run; %YEARSTEP(YEAR =2019 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc datasets library=work nolist; change cake2_2019=&amp;amp;NDSN; quit; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc export data=&amp;amp;NDSN outfile="s:\smm\excel\&amp;amp;ndsn" dbms=csv replace; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend hospseq;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the macro using the parameters below it produces the output file MS2019_ALLcsv.&amp;nbsp; What do I need to do to make the macro produce the CSV file with the CSV extension.&amp;nbsp;So I get&lt;/P&gt;&lt;P&gt;MS2019_all.CSV instead of MS2019_allcsv .&amp;nbsp; If&amp;nbsp; I manually rename the file from MS2019_allCSV to MS2019_All.CSV the file is in the proper format.&amp;nbsp; Thanks for any suggestions.&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;P&gt;%HOSPSEQ(DSN=smm2019,NDSN=MS2019_All);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 18:46:11 GMT</pubDate>
    <dc:creator>Larry3Smith</dc:creator>
    <dc:date>2021-02-26T18:46:11Z</dc:date>
    <item>
      <title>Macro / Filename CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722212#M223906</link>
      <description>&lt;P&gt;I have the following simple macro&lt;/P&gt;&lt;P&gt;%macro hospseq (DSN=,NDSN=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data new2019; set &amp;amp;DSN; run; %YEARSTEP(YEAR =2019 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc datasets library=work nolist; change cake2_2019=&amp;amp;NDSN; quit; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc export data=&amp;amp;NDSN outfile="s:\smm\excel\&amp;amp;ndsn" dbms=csv replace; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend hospseq;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the macro using the parameters below it produces the output file MS2019_ALLcsv.&amp;nbsp; What do I need to do to make the macro produce the CSV file with the CSV extension.&amp;nbsp;So I get&lt;/P&gt;&lt;P&gt;MS2019_all.CSV instead of MS2019_allcsv .&amp;nbsp; If&amp;nbsp; I manually rename the file from MS2019_allCSV to MS2019_All.CSV the file is in the proper format.&amp;nbsp; Thanks for any suggestions.&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;P&gt;%HOSPSEQ(DSN=smm2019,NDSN=MS2019_All);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 18:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722212#M223906</guid>
      <dc:creator>Larry3Smith</dc:creator>
      <dc:date>2021-02-26T18:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro / Filename CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722213#M223907</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/371264"&gt;@Larry3Smith&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have the following simple macro&lt;/P&gt;
&lt;P&gt;%macro hospseq (DSN=,NDSN=);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data new2019; set &amp;amp;DSN; run; %YEARSTEP(YEAR =2019 );&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc datasets library=work nolist; change cake2_2019=&amp;amp;NDSN; quit; run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc export data=&amp;amp;NDSN outfile="s:\smm\excel\&amp;amp;ndsn" dbms=csv replace; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend hospseq;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the macro using the parameters below it produces the output file MS2019_ALLcsv.&amp;nbsp; What do I need to do to make the macro produce the CSV file with the CSV extension.&amp;nbsp;So I get&lt;/P&gt;
&lt;P&gt;MS2019_all.CSV instead of MS2019_allcsv .&amp;nbsp; If&amp;nbsp; I manually rename the file from MS2019_allCSV to MS2019_All.CSV the file is in the proper format.&amp;nbsp; Thanks for any suggestions.&lt;/P&gt;
&lt;P&gt;Larry&lt;/P&gt;
&lt;P&gt;%HOSPSEQ(DSN=smm2019,NDSN=MS2019_All);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Probably need to show us the code in that YEARSTEP macro as none of the code you show creates anything ending in CSV.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Somewhere you likely have a macro variable followed by .csv that needs to have ..csv.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;%let var=ABC;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;var.csv;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;var..csv;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro language uses a single dot to indicate the end of the variable. So you need to have the second to be in the resolved value.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 18:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722213#M223907</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-26T18:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro / Filename CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722232#M223914</link>
      <description>Thanks so much. I changed the part of the proc export outfile to &amp;amp;ndsn..csv and it works great now. Thanks again.</description>
      <pubDate>Fri, 26 Feb 2021 19:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Filename-CSV/m-p/722232#M223914</guid>
      <dc:creator>Larry3Smith</dc:creator>
      <dc:date>2021-02-26T19:27:11Z</dc:date>
    </item>
  </channel>
</rss>

