<?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: Proc Means loop Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177470#M33938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Slchen : Thanks a bunch for your program. It works like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Jaap : Thanks a ton. I know your solution is efficient. It's just i want the tables separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I explore CHARTYPE option. I am not sure how CHARTYPE is useful. I googled it. Many articles say " It helps you to output multiple datasets". This can be done without using CHARTYPE option. See the code below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc Means data = test noprint;&lt;/P&gt;&lt;P&gt;class bu age;&lt;/P&gt;&lt;P&gt;var q1 - q5 ;&lt;/P&gt;&lt;P&gt;output out=F1(where=(_type_=1)&amp;nbsp; drop= BU _FREQ_) mean= median= / autoname;&lt;/P&gt;&lt;P&gt;output out=F2(where=(_type_=2)&amp;nbsp; drop= AGE _FREQ_) mean= median= / autoname;&lt;/P&gt;&lt;P&gt;output out=F3(where=(_type_=3) drop= _FREQ_) mean= median= / autoname;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Jul 2014 15:28:12 GMT</pubDate>
    <dc:creator>Ujjawal</dc:creator>
    <dc:date>2014-07-13T15:28:12Z</dc:date>
    <item>
      <title>Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177460#M33928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a dynamic macro that loops through CLASS variables and generate different output dataset for each of classification variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the program i am working on. It does not loop through CLASS variables. :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test;&lt;/P&gt;&lt;P&gt;Input Q1 Q2 Q3 Q4 Q5 Age BU;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 5 2 3 4 3 3&lt;/P&gt;&lt;P&gt;4 5 2 1 2 1 3&lt;/P&gt;&lt;P&gt;3 4 4 3 2 3 2&lt;/P&gt;&lt;P&gt;4 3 2 5 3 3 3&lt;/P&gt;&lt;P&gt;1 2 4 2 1 2 2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro summary (inputdata= , vars= , groups=, outputdata=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Means data = &amp;amp;inputdata nway noprint;&lt;/P&gt;&lt;P&gt;class &amp;amp;groups;&lt;/P&gt;&lt;P&gt;var &amp;amp;vars&lt;/P&gt;&lt;P&gt;output out=&amp;amp;outputdata (rename=(_freq_=N) drop = _type_) mean= median= / autoname;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%summary(inputdata=test, vars = Q1-Q5, groups=Age BU, outputdata=file1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i want :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. One output file for numeric variables (Q1-Q5) by Age.&lt;/P&gt;&lt;P&gt;2. One output file for numeric variables (Q1-Q5) by BU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro should not be restricted to 2 classification variables. If the number of classification variables (CLASS) increases, it should generate files for each of the classification variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 10:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177460#M33928</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2014-07-13T10:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177461#M33929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Isn't is simpeler to have proc means generated all levels for Age and BU and then do a select on what you are needing?&lt;/P&gt;&lt;P&gt;Assuming Age and BU join do not generate a lot of cells you cand run it using the "in memory" approach " not needing the input dataset to be sorted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 11:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177461#M33929</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-13T11:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177462#M33930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What classification crossing do you want?&amp;nbsp; PROC MEANS has statements to specify the TYPES or WAYS that you are interested in.&amp;nbsp; TYPES has a syntax similar to PROC FREQ table statement.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can have hundreds of CLASS variables as long as you restrict the OUTPUT with TYPES or WAYS to something reasonable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't want a loopy macro for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 12:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177462#M33930</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-07-13T12:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177463#M33931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply. I want output in separate tables. I am a novice in macro programming. I am unable to apply loop in this situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177463#M33931</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2014-07-13T13:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177464#M33932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not need to apply a macro loop as the better solution for your issue is thinking in other way.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177464#M33932</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-13T13:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177465#M33933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Explain separate tables, in detail with example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177465#M33933</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-07-13T13:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177466#M33934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When i say "Separate tables", i mean two output files - one for Age*(Q1-Q5) and second for BU*(Q1-Q5). I don't want output in a single file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the following program automated. Everything is same in the code except CLASS variable and OUT dataset.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Proc Means data = input nway noprint;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;class Age;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;var Q1-Q5;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output out=data1 (rename=(_freq_=N) drop = _type_) mean= median= / autoname;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Proc Means data = input nway noprint;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;class BU;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;var Q1-Q5;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output out=data2 (rename=(_freq_=N) drop = _type_) mean= median= / autoname;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177466#M33934</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2014-07-13T13:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177467#M33935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can split up that single file delivered by proc means more easy to your needs eg using a SAS datastep, this is a common solution.&lt;/P&gt;&lt;P&gt;Why this:&lt;BR /&gt;- proc means will access the input dataset needing calcualtions&lt;/P&gt;&lt;P&gt;&amp;nbsp; You only need to access all input data once not looped, to create that dataset having all type nway information.. &lt;/P&gt;&lt;P&gt;- using a sas datastep splitting up in many sas datsets is a feature also needing reading once the input but support also a split up in one run. &lt;/P&gt;&lt;P&gt;&amp;nbsp; This is a very efficient way of splitting up when needed.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; In this case see the resulting dataset of proc means&amp;nbsp; as intermediate result for a solution having more steps.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;For your information this is part of the SAS advanced course where thinking on effects on performance is coming into the topics.&lt;BR /&gt;A lot of people are getting into trouble when data is somewhat more big as just the tiny samples. The Cartesian product warning is a famous one. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177467#M33935</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-13T13:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177468#M33936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro summary (inputdata= , vars= , groups=, outputdata=);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let i=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %do %while (%scan(&amp;amp;groups,&amp;amp;i) ne );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let group=%scan(&amp;amp;groups,&amp;amp;i);&lt;/P&gt;&lt;P&gt;Proc Means data = &amp;amp;inputdata nway noprint;&lt;/P&gt;&lt;P&gt;class &amp;amp;group;&lt;/P&gt;&lt;P&gt;var &amp;amp;vars;&lt;/P&gt;&lt;P&gt;output out=&amp;amp;outputdata.&amp;amp;i (rename=(_freq_=N) drop = _type_) mean= median= / autoname;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %let i=%eval(&amp;amp;i+1);&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%summary(inputdata=test, vars =Q1-Q5, groups=Age BU, outputdata=file);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177468#M33936</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-07-13T13:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177469#M33937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;run this code, look at tstint, you will notice _type_ is having the selection of the needed class specification&amp;nbsp; 10&amp;nbsp; or 01 is according the order in the class statement&lt;BR /&gt;When you need to split up further a macro on the class definition using a datastep split is possible ... joining and combining in next steps preparing for other analytics.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc Means data = test noprint chartype ;&lt;BR /&gt;class bu age;&lt;BR /&gt;var q1 - q5 ;&lt;BR /&gt;output out=testint mean= median= / autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 14:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177469#M33937</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-13T14:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177470#M33938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Slchen : Thanks a bunch for your program. It works like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Jaap : Thanks a ton. I know your solution is efficient. It's just i want the tables separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I explore CHARTYPE option. I am not sure how CHARTYPE is useful. I googled it. Many articles say " It helps you to output multiple datasets". This can be done without using CHARTYPE option. See the code below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc Means data = test noprint;&lt;/P&gt;&lt;P&gt;class bu age;&lt;/P&gt;&lt;P&gt;var q1 - q5 ;&lt;/P&gt;&lt;P&gt;output out=F1(where=(_type_=1)&amp;nbsp; drop= BU _FREQ_) mean= median= / autoname;&lt;/P&gt;&lt;P&gt;output out=F2(where=(_type_=2)&amp;nbsp; drop= AGE _FREQ_) mean= median= / autoname;&lt;/P&gt;&lt;P&gt;output out=F3(where=(_type_=3) drop= _FREQ_) mean= median= / autoname;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 15:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177470#M33938</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2014-07-13T15:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177471#M33939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the chartype because it gets a binary 0/1 indication on each class variable. With this one it should be always possible to select on each class combination. &lt;BR /&gt;The coding is however more cumbersome to achieve there is more easier approach when you want just one of each class variable.&lt;/P&gt;&lt;P&gt;Proc measn has evolved a lot see: &lt;A href="http://support.sas.com/documentation/cdl/en/proc/66663/HTML/default/viewer.htm#n1qnc9bddfvhzqn105kqitnf29cp.htm" title="http://support.sas.com/documentation/cdl/en/proc/66663/HTML/default/viewer.htm#n1qnc9bddfvhzqn105kqitnf29cp.htm"&gt;Base SAS(R) 9.4 Procedures Guide, Second Edition&lt;/A&gt;&amp;nbsp; threads (multithreading) memory and all kind of others. Interesting the clasdata and types.&lt;BR /&gt;Adding types after class is making a sas dataset where each class variable is not missing as like al your wanted datasets are appended.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc Means data = test noprint chartype ;&lt;BR /&gt;class bu age;&lt;BR /&gt;types bu age;&lt;BR /&gt;var q1 - q5 ;&lt;BR /&gt;output out=testint mean= median= / autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Splitting up now is more easy&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro splitmean&amp;nbsp; (inp= , groups= ) ;&amp;nbsp; &lt;/P&gt;&lt;P&gt; /* build all output datasets as splitter */ &lt;BR /&gt; data &lt;BR /&gt;&amp;nbsp; %let i=1;&amp;nbsp; %let group=%scan(&amp;amp;groups,&amp;amp;i);&lt;BR /&gt;&amp;nbsp; %do %while (%length(&amp;amp;group) &amp;gt; 0 );&lt;BR /&gt;&amp;nbsp; mnspl_&amp;amp;group&lt;BR /&gt;&amp;nbsp; %let i=%eval(&amp;amp;i+1); %let group=%scan(&amp;amp;groups,&amp;amp;i);&lt;BR /&gt;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; set &amp;amp;inp (drop=_type_) ;&lt;BR /&gt; &lt;BR /&gt; /* redirect each record to a dedicated output dataset */&lt;BR /&gt;&amp;nbsp; Select ;&lt;BR /&gt;&amp;nbsp; %let i=1;&amp;nbsp; %let group=%scan(&amp;amp;groups,&amp;amp;i);&lt;BR /&gt;&amp;nbsp; %do %while (%length(&amp;amp;group) &amp;gt; 0 );&lt;BR /&gt;&amp;nbsp; When ( &amp;amp;group ne . ) output mnspl_&amp;amp;group ;&lt;BR /&gt;&amp;nbsp; %let i=%eval(&amp;amp;i+1); %let group=%scan(&amp;amp;groups,&amp;amp;i);&lt;BR /&gt;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp; Otherwise ;&lt;BR /&gt;&amp;nbsp; end; &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;%mend ;&lt;/P&gt;&lt;P&gt;%splitmean (inp=testint, groups=bu age) ; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 16:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177471#M33939</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-13T16:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means loop Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177472#M33940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think proc means will run once on the input datasets but having multiple ouput statements (reports?) need to reseve space multiple time in memory for all calculations.&lt;BR /&gt;There are always a lot of approaches and solutions with SAS but not all of them are performing or having the resources usage being used efficiency equal. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 16:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means-loop-Macro/m-p/177472#M33940</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-13T16:20:19Z</dc:date>
    </item>
  </channel>
</rss>

