<?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: Need Help with Macro Variables Used in File Name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163831#M31703</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a solution that works for you please mark the question answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2015 18:30:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-02-11T18:30:38Z</dc:date>
    <item>
      <title>Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163823#M31695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble getting the following code to work.&amp;nbsp; The SAS code is numbered, with the SYMBOLGEN and MLOGIC used to show that the macro itself appears to be evaluating properly.&amp;nbsp; However, there is an error with calling the file using the macro variables created in the code, specifically YY6 and QQ6.&amp;nbsp; Please note that the same error occurs whether the file name (DAT1.POL&amp;amp;YY6&amp;amp;QQ6) is in double quotes or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPTIONS SYMBOLGEN MLOGIC;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET YYC = 14; *CURRENT REPORTING PERIOD YEAR*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET QQC = 06; *CURRENT REPORTING PERIOD QUARTER*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %MACRO LIFDATES;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %IF &amp;amp;QQC = 06 %THEN &lt;SPAN style="color: #ff0000;"&gt;%LET QQ6 = 12;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %IF &amp;amp;QQC = 12 %THEN &lt;SPAN style="color: #ff0000;"&gt;%LET QQ6 = 06;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %IF &amp;amp;QQC = 06 %THEN &lt;SPAN style="color: #ff0000;"&gt;%LET YY6 = %EVAL(&amp;amp;YYC-1);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %IF &amp;amp;QQC = 12 %THEN &lt;SPAN style="color: #ff0000;"&gt;%LET YY6 = %EVAL(&amp;amp;YYC);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET QQP = %EVAL(&amp;amp;QQC);&amp;nbsp;&amp;nbsp; *PREV QUARTER FOR YEAR-OVER-YEAR COMPS;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET YYP = %EVAL(&amp;amp;YYC-1); *PREV YEAR FOR YEAR-OVER-YEAR COMPS;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET QQP6= %EVAL(&amp;amp;QQ6);&amp;nbsp; *PREV QTR FOR PREV PERIOD (6 MO BEF QQP);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET YYP6= %EVAL(&amp;amp;YY6-1);*PREV YEAR FOR PREV PERIOD (6 MO BEF QQP);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET PYE = %EVAL((&amp;amp;YYP*100)+12);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET PYE12 = %EVAL(((&amp;amp;YYP-1)*100)+12);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %MEND LIFDATES;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LIFDATES; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; Beginning execution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable QQC resolves to 06&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %IF condition &amp;amp;QQC = 06 is TRUE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is QQ6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable QQC resolves to 06&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %IF condition &amp;amp;QQC = 12 is FALSE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable QQC resolves to 06&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %IF condition &amp;amp;QQC = 06 is TRUE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is YY6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable YYC resolves to 14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable QQC resolves to 06&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %IF condition &amp;amp;QQC = 12 is FALSE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is QQP)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable QQC resolves to 06&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is YYP)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable YYC resolves to 14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is QQP6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;Macro variable QQ6 resolves to 12&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is YYP6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;Macro variable YY6 resolves to 13&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is PYE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable YYP resolves to 13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; %LET (variable name is PYE12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable YYP resolves to 13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MLOGIC(LIFDATES):&amp;nbsp; Ending execution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIBNAME DAT1 'MRKTCR2.SAS.P4158D1';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA POLPC; /*PRIOR SIX MONTHS*/ SET DAT1.POL&amp;amp;YY6&amp;amp;QQ6;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _&amp;nbsp;&amp;nbsp; _&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&amp;nbsp; 22&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200 200&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;WARNING: Apparent symbolic reference YY6 not resolved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #ff0000;"&gt;WARNING: Apparent symbolic reference QQ6 not resolved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ERROR: File WORK.YY6.DATA does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ERROR: File WORK.QQ6.DATA does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163823#M31695</guid>
      <dc:creator>BryanMarks</dc:creator>
      <dc:date>2015-02-11T17:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163824#M31696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macro variable scope, Local vs Global&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro variables exist in the macro but don't exist once the macro has finished executing. &lt;/P&gt;&lt;P&gt;Add the following line to the top of your code to create Global.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%global yy6 qq6; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163824#M31696</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-11T17:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163825#M31697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Reeza!&amp;nbsp; Thanks for replying so quickly!&amp;nbsp; Does the %GLOBAL command need to be inside or outside the %MACRO LIFDATES; code?&amp;nbsp; I assume also that all of the other created variables in that section (between %MACRO-%MEND) also need to be referenced in the %GLOBAL command, correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163825#M31697</guid>
      <dc:creator>BryanMarks</dc:creator>
      <dc:date>2015-02-11T17:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163826#M31698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since your %LET was inside of macro it probably defined a local macro variable that disappeared once the macro ended.&lt;/P&gt;&lt;P&gt;So your reference to YY6 in line 24 is not finding any macro variable with that name.&lt;/P&gt;&lt;P&gt;You could use %GLOBAL to define the macro as global, or just make sure it already exists before calling the macro.&amp;nbsp; Then the %LET will change the existing macro variable's value instead of making a new local macro variable.&lt;/P&gt;&lt;P&gt;Why not just add &lt;/P&gt;&lt;P&gt;%LET YY6=;&lt;/P&gt;&lt;P&gt;%LET QQ6=;&lt;/P&gt;&lt;P&gt;in between lines 3 and 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the purpose of all that macro?&amp;nbsp; Perhaps you could do it easier using INTNX function calls?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163826#M31698</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-11T17:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163827#M31699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either location. Any macro variable you want to reference outside of the macro needs to be in the global statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use @Tom recommendation and rewrite the code into a data step using the intnx function, combined with call symputx function that has a third argument to set a macro variable to Global/Local&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd go with option 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163827#M31699</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-11T17:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163828#M31700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Tom &amp;amp; Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't aware that creating variables within the macro (between %MACRO-%MEND) would limit their existence to only that part of the program.&amp;nbsp; I'm not familiar with the intnx function at all and have only a small amount of knowledge about the symputx function, so I think I'd better stick to the %GLOBAL code or create the variables outside of the %MACRO-%MEND code. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of that other code in the %MACRO LIFDATES will be used to reference files from multiple points in time for comparisons (e.g., year over year, last six months of current year, last six months of previous year).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all of your help!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163828#M31700</guid>
      <dc:creator>BryanMarks</dc:creator>
      <dc:date>2015-02-11T17:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163829#M31701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need for a macro or a data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; date='01JUN2014'd ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pre6m = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(intnx(month,&amp;amp;date,-6),YYMMDD4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; preyr = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(intnx(month,&amp;amp;date,-12),YYMMDD4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;=pre6m &amp;amp;=preyr ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New';"&gt;PRE6M=1312 PREYR=1306&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 17:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163829#M31701</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-11T17:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163830#M31702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Tom!&amp;nbsp; That suggestion looks promising!&amp;nbsp; I'll consider rewriting the macro to use it! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163830#M31702</guid>
      <dc:creator>BryanMarks</dc:creator>
      <dc:date>2015-02-11T18:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Macro Variables Used in File Name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163831#M31703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a solution that works for you please mark the question answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Macro-Variables-Used-in-File-Name/m-p/163831#M31703</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-11T18:30:38Z</dc:date>
    </item>
  </channel>
</rss>

