<?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 Run macro in less rows of code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821028#M324119</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Let's say that I want to run a macro and there are 9 runs.&lt;/P&gt;
&lt;P&gt;Is there a clever way to run it in less code rows?&lt;/P&gt;
&lt;P&gt;Please note that 1812/1806/1801 are dates in form YYMM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Dist(1812,Cars_Consume1812, "Cars_consume");
%dist(1806,Cars_Consume1806, "Cars_consume");
%dist(1801,Cars_Consume1801, "Cars_consume");

%dist(1812,cars_age1812, "cars age in years");
%dist(1806,cars_age1806, "cars age in years");
%dist(1801,cars_age1801, "cars age in years");

%dist(1812,Car_engine_size1812,  "Car Engine size");
%dist(1806,Car_engine_size1806,  "Car Engine size");
%dist(1801,Car_engine_size1801,  "Car Engine size");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Jun 2022 21:03:36 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-06-29T21:03:36Z</dc:date>
    <item>
      <title>Run macro in less rows of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821028#M324119</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Let's say that I want to run a macro and there are 9 runs.&lt;/P&gt;
&lt;P&gt;Is there a clever way to run it in less code rows?&lt;/P&gt;
&lt;P&gt;Please note that 1812/1806/1801 are dates in form YYMM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Dist(1812,Cars_Consume1812, "Cars_consume");
%dist(1806,Cars_Consume1806, "Cars_consume");
%dist(1801,Cars_Consume1801, "Cars_consume");

%dist(1812,cars_age1812, "cars age in years");
%dist(1806,cars_age1806, "cars age in years");
%dist(1801,cars_age1801, "cars age in years");

%dist(1812,Car_engine_size1812,  "Car Engine size");
%dist(1806,Car_engine_size1806,  "Car Engine size");
%dist(1801,Car_engine_size1801,  "Car Engine size");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jun 2022 21:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821028#M324119</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-06-29T21:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Run macro in less rows of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821032#M324123</link>
      <description>&lt;P&gt;I don't know what %DIST does, but I'm sure we have discussed putting your data into a good format for analysis. In particular, putting calendar information into variable names is a bad idea, which requires more coding effort, as you can see in this example. On the other hand, if your calendar YYMM was contained in a variable in the data set, you could use BY statements or something like PROC SUMMARY and then you don't even have to specify what months you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Is there a clever way to run it in less code rows?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, arrange your data into a better format, then multiple analyses will be simple. Maxim 19. Maxim 33.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 21:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821032#M324123</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-29T21:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Run macro in less rows of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821038#M324127</link>
      <description>&lt;P&gt;Does your code go beyond what's shown? For 9 calls any more attempts at efficiency will likely be the same amount of code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 22:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821038#M324127</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-29T22:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Run macro in less rows of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821041#M324128</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Run_Dist (Dist_Type=);

%Dist(1812,Cars_Consume1812, "&amp;amp;Dist_Type");
%Dist(1806,Cars_Consume1806, "&amp;amp;Dist_Type");
%Dist(1801,Cars_Consume1801, "&amp;amp;Dist_Type");

%mend Run_Dist;

%Run_Dist (Dist_Type=Cars_consume);
%Run_Dist (Dist_Type=Cars age in years);
%Run_Dist (Dist_Type=Cars Engine size);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jun 2022 22:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-macro-in-less-rows-of-code/m-p/821041#M324128</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-29T22:19:17Z</dc:date>
    </item>
  </channel>
</rss>

