<?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 value in ods Output filename in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648049#M194035</link>
    <description>That was it. Thanks</description>
    <pubDate>Fri, 15 May 2020 14:21:36 GMT</pubDate>
    <dc:creator>RandoDando</dc:creator>
    <dc:date>2020-05-15T14:21:36Z</dc:date>
    <item>
      <title>Macro value in ods Output filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648043#M194030</link>
      <description>&lt;P&gt;I have a macro text value I have initiated with the %let statement.&amp;nbsp; The value is entered manually and then used throughout the code, including in a&amp;nbsp; &amp;nbsp;ODS output statement where I have the macro value in the file name of the PDF.&amp;nbsp; However, each time I run this it does not read the macro value and outputs the macro name instead.&amp;nbsp; I know to use double quotes for these.&amp;nbsp; One of the folder names in the directory has a &amp;amp;&amp;nbsp; (unable to change that on my end).&amp;nbsp; Each time I export there I get warnings in my log about it not locating a macro, but I usually overlook it because I know it's a folder name.&amp;nbsp; It doesn't impact SAS's ability to find the location and export the file, however this is my first attempt in using a macro in the filename when exporting there.&amp;nbsp; Could that be affecting SAS's ability to read an&amp;nbsp;&lt;EM&gt;actual&amp;nbsp;&lt;/EM&gt;macro in the filename statement?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have been unable to test other export locations as this is the only one I can map to at the moment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let IDvlue = XX999;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ods pdf file="\\....\OUTPUT_Table_&amp;amp;IDvlue.pdf";&lt;BR /&gt;...&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 14:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648043#M194030</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-15T14:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro value in ods Output filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648045#M194031</link>
      <description>&lt;P&gt;I believe you need an extra . period after the macro var reference i.e.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let IDvlue = XX999;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ods pdf file="\\....\OUTPUT_Table_&amp;amp;IDvlue..pdf";&lt;BR /&gt;...&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 14:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648045#M194031</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T14:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro value in ods Output filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648049#M194035</link>
      <description>That was it. Thanks</description>
      <pubDate>Fri, 15 May 2020 14:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648049#M194035</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-15T14:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro value in ods Output filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648064#M194044</link>
      <description>&lt;P&gt;If you look in that folder you likely have a file without an extension the looks like Output_table_XX999pdf.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The dot character after a macro variable indicates the end of the macro variable name, almost like a concatenation.&lt;/P&gt;
&lt;P&gt;If macrovar has the value of ABC then&amp;nbsp; &amp;amp;macrovar.XYZ resolves to ABCXYZ. Without the dot you would get an error for &amp;amp;macrovarXYZ that the macro variable MacrovarXYZ does not exist. So when you have a macro variable that has to be followed by a dot, such as in a file extension or a libname.data set name you need an extra dot. One to end the macro variable the next to be literal text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 15:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-value-in-ods-Output-filename/m-p/648064#M194044</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-15T15:14:48Z</dc:date>
    </item>
  </channel>
</rss>

