<?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 error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711774#M219310</link>
    <description>Restarting SAS worked. Thank you!</description>
    <pubDate>Fri, 15 Jan 2021 20:49:20 GMT</pubDate>
    <dc:creator>RebeccaB_</dc:creator>
    <dc:date>2021-01-15T20:49:20Z</dc:date>
    <item>
      <title>MACRO error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711755#M219303</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm new to writing macros and have received the following error in my code. For reference, the macro ran correctly prior to me adding the dummy variable code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Invalid macro name (. It should be a valid SAS identifier no longer than 32 characters.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: A dummy macro will be compiled.&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;FONT color="#339966"&gt;/*CONTROL BY TIMEFRAME*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%MACRO fin(file);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;DATA work.&amp;amp;file._dm4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;SET work.&amp;amp;file._dm3;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;IF (a1c_result&amp;lt;= &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; THEN DM_control = 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;IF (8&amp;lt; a1c_result &amp;lt;= 9) THEN DM_control = 2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;IF (a1c_result &amp;gt; 9) OR (a1c_result = .) THEN DM_control = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;run;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;data work.&amp;amp;file._dm5;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;set work.&amp;amp;file._dm4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;if dm_control=1 then well_cntrl=1; else well_cntrl=0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;if dm_control=2 then cntrl=1; else cntrl=0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;if dm_control=0 then uncntrl=1; else uncntrl=0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;%MEND fin;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;%fin(Baseline);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q1_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q2_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q3_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q4_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q1_2020);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q2_2020);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks in advance for any clarifications or suggestions!&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 19:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711755#M219303</guid>
      <dc:creator>RebeccaB_</dc:creator>
      <dc:date>2021-01-15T19:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711759#M219304</link>
      <description>&lt;P&gt;FILE is a reserved a key word, perhaps try using a differently name macro variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p0y43hj7lzhq1gn1r68h65wzljbt.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p0y43hj7lzhq1gn1r68h65wzljbt.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/356491"&gt;@RebeccaB_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I'm new to writing macros and have received the following error in my code. For reference, the macro ran correctly prior to me adding the dummy variable code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Invalid macro name (. It should be a valid SAS identifier no longer than 32 characters.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: A dummy macro will be compiled.&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;FONT color="#339966"&gt;/*CONTROL BY TIMEFRAME*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%MACRO fin(file);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;DATA work.&amp;amp;file._dm4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;SET work.&amp;amp;file._dm3;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;IF (a1c_result&amp;lt;= &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; THEN DM_control = 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;IF (8&amp;lt; a1c_result &amp;lt;= 9) THEN DM_control = 2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;IF (a1c_result &amp;gt; 9) OR (a1c_result = .) THEN DM_control = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;run;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;data work.&amp;amp;file._dm5;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;set work.&amp;amp;file._dm4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;if dm_control=1 then well_cntrl=1; else well_cntrl=0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;if dm_control=2 then cntrl=1; else cntrl=0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;if dm_control=0 then uncntrl=1; else uncntrl=0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;%MEND fin;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;%fin(Baseline);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q1_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q2_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q3_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q4_2019);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q1_2020);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;%fin(Q2_2020);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks in advance for any clarifications or suggestions!&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 19:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711759#M219304</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-15T19:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711760#M219305</link>
      <description>&lt;P&gt;I do not see anything wrong with your code. Turn on MPRINT option and show relevant lines for the SAS LOG.&amp;nbsp; Make sure to use the Insert Code button (looks like &amp;lt; / &amp;gt;) to get a pop-up window to paste the lines of text so that the code is not converted into emojii like in your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 19:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711760#M219305</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T19:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711766#M219306</link>
      <description>&lt;P&gt;When I simplify your shown code to:&lt;/P&gt;
&lt;PRE&gt;%MACRO fin(file);

DATA work.&amp;amp;file._dm4;
 set sashelp.class;
run;

%mend;

%fin(Baseline);&lt;/PRE&gt;
&lt;P&gt;I have no problem:&lt;/P&gt;
&lt;PRE&gt;265  %MACRO fin(file);
266
267  DATA work.&amp;amp;file._dm4;
268   set sashelp.class;
269  run;
270
271  %mend;
NOTE: The macro FIN completed compilation without errors.
      9 instructions 192 bytes.

272  %fin(Baseline);

NOTE: There were 19 observations read from the data set
      SASHELP.CLASS.
&lt;/PRE&gt;
&lt;P&gt;I suspect some other problem previously may be an issue with code thinking something other than what you show is the issue. You might try saving your code and restarting SAS. Some macro issues can be pretty persistent an this may be only the way to recover.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For future note, when asking about Error or other messages from the log, include the entire procedure or data step code prior to the messages along with all of the notes, warnings and or errors. Copy from the log and paste into a text box opened on the forum with the &amp;lt;/&amp;gt; icon to preserve the formatting of the text and any diagnostic characters that SAS may have in the log.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 20:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711766#M219306</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-15T20:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711774#M219310</link>
      <description>Restarting SAS worked. Thank you!</description>
      <pubDate>Fri, 15 Jan 2021 20:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-error/m-p/711774#M219310</guid>
      <dc:creator>RebeccaB_</dc:creator>
      <dc:date>2021-01-15T20:49:20Z</dc:date>
    </item>
  </channel>
</rss>

