<?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: Why do I not get a result when this Macro is run? Please help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957956#M373909</link>
    <description>&lt;P&gt;Are you sure the macro is being invoked and the Proc MEANS is run?&lt;/P&gt;
&lt;P&gt;During code development you can sometimes have an unclosed string or parenthetical expression, which will cause the most recent 'Run' or 'Submit' to have Log lines that humans see as &lt;EM&gt;nothing was done&lt;/EM&gt;.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Feb 2025 16:33:04 GMT</pubDate>
    <dc:creator>RichardAD</dc:creator>
    <dc:date>2025-02-02T16:33:04Z</dc:date>
    <item>
      <title>Why do I not get a result when this Macro is run? Please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957947#M373903</link>
      <description>&lt;P&gt;%Macro orderstats(var=Total_Retail_Price, class=Customer_ID, stats=mean,&lt;BR /&gt;decimals=2);&lt;BR /&gt;options nolabel;&lt;BR /&gt;&lt;BR /&gt;title 'Order Stats';&lt;/P&gt;&lt;P&gt;proc means data=mc1.orders maxdec=&amp;amp;decimals &amp;amp;stats;&lt;BR /&gt;var &amp;amp;var;&lt;BR /&gt;class &amp;amp;class;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title;&lt;BR /&gt;options label;&lt;BR /&gt;%mend Orderstats;&lt;/P&gt;&lt;P&gt;%orderstats()&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2025 14:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957947#M373903</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-02-02T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I not get a result when this Macro is run? Please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957951#M373905</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sure the input data set exists / is spelled correctly and are the variable names correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please add the following statement to the start of the code for diagnostics and then run the code again:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then please share the log using the Insert Code icon "&amp;lt;/&amp;gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried replicating the code by copying data set sashelp.class and using that in your macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data orders;
  set sashelp.class(rename=(Age = Total_Retail_Price name = Customer_ID));
run;


options mprint;


%Macro orderstats(var=Total_Retail_Price, class=Customer_ID, stats=mean,
decimals=2);
options nolabel;

title 'Order Stats';

proc means data=orders maxdec=&amp;amp;decimals &amp;amp;stats;
var &amp;amp;var;
class &amp;amp;class;
run;

title;
options label;
%mend Orderstats;

%orderstats()
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amir_0-1738507569887.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104237iF4F6F2E93721D189/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amir_0-1738507569887.png" alt="Amir_0-1738507569887.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My log shows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; 72         data orders;
 73           set sashelp.class(rename=(Age = Total_Retail_Price name = Customer_ID));
 74         run;
 
 NOTE: There were 19 observations read from the data set SASHELP.CLASS.
 NOTE: The data set WORK.ORDERS has 19 observations and 5 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              833.09k
       OS Memory           23204.00k
       Timestamp           02/02/2025 02:43:20 PM
       Step Count                        38  Switch Count  2
       Page Faults                       0
       Page Reclaims                     150
       Page Swaps                        0
       Voluntary Context Switches        10
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           264
       
 
 75         
 76         
 77         options mprint;
 78         
 79         
 80         %Macro orderstats(var=Total_Retail_Price, class=Customer_ID, stats=mean,
 81         decimals=2);
 82         options nolabel;
 83         
 84         title 'Order Stats';
 85         
 86         proc means data=orders maxdec=&amp;amp;decimals &amp;amp;stats;
 87         var &amp;amp;var;
 88         class &amp;amp;class;
 89         run;
 90         
 91         title;
 92         options label;
 93         %mend Orderstats;
 94         
 95         %orderstats()
 MPRINT(ORDERSTATS):   options nolabel;
 MPRINT(ORDERSTATS):   title 'Order Stats';
 MPRINT(ORDERSTATS):   proc means data=orders maxdec=2 mean;
 MPRINT(ORDERSTATS):   var Total_Retail_Price;
 MPRINT(ORDERSTATS):   class Customer_ID;
 MPRINT(ORDERSTATS):   run;
 
 NOTE: There were 19 observations read from the data set WORK.ORDERS.
 NOTE: PROCEDURE MEANS used (Total process time):
       real time           0.03 seconds
       user cpu time       0.03 seconds
       system cpu time     0.01 seconds
       memory              10110.90k
       OS Memory           33208.00k
       Timestamp           02/02/2025 02:43:20 PM
       Step Count                        39  Switch Count  1
       Page Faults                       0
       Page Reclaims                     2408
       Page Swaps                        0
       Voluntary Context Switches        12
       Involuntary Context Switches      1
       Block Input Operations            0
       Block Output Operations           8
       
 
 MPRINT(ORDERSTATS):   title;
 MPRINT(ORDERSTATS):   options label;
 96         
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2025 14:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957951#M373905</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2025-02-02T14:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I not get a result when this Macro is run? Please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957955#M373908</link>
      <description>&lt;P&gt;Hello, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/472415"&gt;@hmlong25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Any time code doesn't work right, we need to see the log, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt; said (whether its macro code or not). Use the macro debuggin command &lt;FONT face="courier new,courier"&gt;options mprint;&lt;/FONT&gt;&amp;nbsp; before your run the macro.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2025 16:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957955#M373908</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-02-02T16:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I not get a result when this Macro is run? Please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957956#M373909</link>
      <description>&lt;P&gt;Are you sure the macro is being invoked and the Proc MEANS is run?&lt;/P&gt;
&lt;P&gt;During code development you can sometimes have an unclosed string or parenthetical expression, which will cause the most recent 'Run' or 'Submit' to have Log lines that humans see as &lt;EM&gt;nothing was done&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2025 16:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957956#M373909</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-02-02T16:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I not get a result when this Macro is run? Please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957961#M373912</link>
      <description>My computer connection prevented it from running. So all is well!</description>
      <pubDate>Sun, 02 Feb 2025 19:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-do-I-not-get-a-result-when-this-Macro-is-run-Please-help/m-p/957961#M373912</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-02-02T19:10:36Z</dc:date>
    </item>
  </channel>
</rss>

