<?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: macro variable in proc export excel file name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172111#M264358</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to reference a macro variable using &amp;amp;, so &amp;amp;var01STR.&lt;/P&gt;&lt;P&gt;And if quoting, you need double quotes for the macro variable to resolve.&lt;/P&gt;&lt;P&gt;Also, you need to add a . to denote where the variable name ends, so SAS know's the which macrovariable to resolve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO A (VAR01, VAR01STR);&lt;/P&gt;&lt;P&gt;PROC EXPORT&lt;/P&gt;&lt;P&gt;DATA= &amp;amp;VAR01&lt;/P&gt;&lt;P&gt;OUTFILE='C:\DATA\&amp;amp;VAR01STR..XLSX'&lt;/P&gt;&lt;P&gt;DBMS = XLSX REPLACE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%MEND;&lt;/P&gt;&lt;P&gt;%A(ID01,%STR(ID01.));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Dec 2013 21:12:17 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-12-12T21:12:17Z</dc:date>
    <item>
      <title>macro variable in proc export excel file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172110#M264357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code have: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO A (VAR01, VAR01STR);&lt;/P&gt;&lt;P&gt;PROC EXPORT&lt;/P&gt;&lt;P&gt;DATA= &amp;amp;VAR01&lt;/P&gt;&lt;P&gt;OUTFILE='C:\DATA\VAR01STR.XLSX' &lt;/P&gt;&lt;P&gt;DBMS = XLSX REPLACE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%MEND; &lt;/P&gt;&lt;P&gt;%A(ID01,%STR(ID01.));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Want output file with name ID01.XLSX.&lt;/P&gt;&lt;P&gt;But right now output file name is VAR01STR.XLSX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 21:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172110#M264357</guid>
      <dc:creator>peppapig</dc:creator>
      <dc:date>2013-12-12T21:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable in proc export excel file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172111#M264358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to reference a macro variable using &amp;amp;, so &amp;amp;var01STR.&lt;/P&gt;&lt;P&gt;And if quoting, you need double quotes for the macro variable to resolve.&lt;/P&gt;&lt;P&gt;Also, you need to add a . to denote where the variable name ends, so SAS know's the which macrovariable to resolve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO A (VAR01, VAR01STR);&lt;/P&gt;&lt;P&gt;PROC EXPORT&lt;/P&gt;&lt;P&gt;DATA= &amp;amp;VAR01&lt;/P&gt;&lt;P&gt;OUTFILE='C:\DATA\&amp;amp;VAR01STR..XLSX'&lt;/P&gt;&lt;P&gt;DBMS = XLSX REPLACE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%MEND;&lt;/P&gt;&lt;P&gt;%A(ID01,%STR(ID01.));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 21:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172111#M264358</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-12T21:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable in proc export excel file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172112#M264359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AND the string has to use " instead of '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"C:\data\&amp;amp;Var01Str..xlsx"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 22:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172112#M264359</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-12-12T22:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable in proc export excel file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172113#M264360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro variable wonn't resolve in Single Quotes " ' ".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sanjeev.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 12:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-proc-export-excel-file-name/m-p/172113#M264360</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2013-12-13T12:18:03Z</dc:date>
    </item>
  </channel>
</rss>

