<?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 not running at all, no errors. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581152#M13644</link>
    <description>&lt;P&gt;Woops! Thanks!! Yes, that worked and I had to use . after my &amp;amp;no macro variable.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2019 14:41:46 GMT</pubDate>
    <dc:creator>accintron</dc:creator>
    <dc:date>2019-08-14T14:41:46Z</dc:date>
    <item>
      <title>Macro not running at all, no errors.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581143#M13638</link>
      <description>&lt;P&gt;I've tried restarting my SAS program and computer and this macro is just not running, no errors, nothing - just the code is in the log... I'm probably missing the simplest thing... am I calling in the macro variables correctly? I know sometimes you utilize a period so I thought that would be appropriate for the second macro variable.... Thanks for your help in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro DX(no=, var=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table dx_&amp;amp;no as&lt;BR /&gt;select a.admission_id, b.DIAG_DESC&lt;BR /&gt;from adms_5 a left join table.DIAGNOSIS b on a.&amp;amp;var.=b.DIAG_CD;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%DX(no=1, var=DIAG_CD_1);&lt;BR /&gt;%DX(no=2, var=DIAG_CD_2_1);&lt;BR /&gt;%DX(no=3, var=DIAG_CD_2_4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend DX;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581143#M13638</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-08-14T14:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not running at all, no errors.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581147#M13641</link>
      <description>&lt;P&gt;You defined the macro, you never told SAS to execute the macro after it has been defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These go after %MEND;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%DX(no=1, var=DIAG_CD_1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%DX(no=2, var=DIAG_CD_2_1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%DX(no=3, var=DIAG_CD_2_4)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581147#M13641</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-08-14T14:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not running at all, no errors.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581151#M13643</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285053"&gt;@accintron&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I've tried restarting my SAS program and computer and this macro is just not running, no errors, nothing - just the code is in the log... I'm probably missing the simplest thing... am I calling in the macro variables correctly? I know sometimes you utilize a period so I thought that would be appropriate for the second macro variable.... Thanks for your help in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro DX(no=, var=);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table dx_&amp;amp;no as&lt;BR /&gt;select a.admission_id, b.DIAG_DESC&lt;BR /&gt;from adms_5 a left join table.DIAGNOSIS b on a.&amp;amp;var.=b.DIAG_CD;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%DX(no=1, var=DIAG_CD_1);&lt;BR /&gt;%DX(no=2, var=DIAG_CD_2_1);&lt;BR /&gt;%DX(no=3, var=DIAG_CD_2_4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend DX;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;%macro DX(no=, var=);

proc sql;
create table dx_&amp;amp;no as
select a.admission_id, b.DIAG_DESC
from adms_5 a left join table.DIAGNOSIS b on a.&amp;amp;var.=b.DIAG_CD;
quit;
&lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;
%mend DX; 
&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
%DX(no=1, var=DIAG_CD_1);
%DX(no=2, var=DIAG_CD_2_1);
%DX(no=3, var=DIAG_CD_2_4);

 


&lt;/PRE&gt;
&lt;P&gt;Attempting to use the macro in the defining code is a path to madness and unexpected results.&lt;/P&gt;
&lt;P&gt;I would also suggest shutting down SAS and restarting as you may have created an very unstable situation.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581151#M13643</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-14T14:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not running at all, no errors.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581152#M13644</link>
      <description>&lt;P&gt;Woops! Thanks!! Yes, that worked and I had to use . after my &amp;amp;no macro variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581152#M13644</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-08-14T14:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro not running at all, no errors.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581153#M13645</link>
      <description>&lt;P&gt;Thank you! Yes, definitely will restart SAS fresh now that the code is working appropriately!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-not-running-at-all-no-errors/m-p/581153#M13645</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-08-14T14:42:49Z</dc:date>
    </item>
  </channel>
</rss>

