<?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: Warning with PROC MEANS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348009#M80531</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets start from fresh here, what is it your trying to achieve - post some example output. &amp;nbsp;Its never a good idea to jump into macro programming when its not fully understood. &amp;nbsp;What your macro is doing is repeating that proc means code for every number between 1 and &amp;amp;age. &amp;nbsp;So in the example it does:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;means&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;mydata&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;age&lt;SPAN class="token operator"&gt;=1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; q1 q3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will return 0 observations&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;means&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;mydata&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;age&lt;SPAN class="token operator"&gt;=2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; q1 q3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Which will return 0 observations etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really can't state this clearly enough, macro is not a) a simple tool, b) not to be used to replace base SAS programming. &amp;nbsp;Anything you want to do can be done in base SAS, so don't complicate your thinking by macro'ing it. &amp;nbsp;Post example requirements for further help.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 08:37:39 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-04-07T08:37:39Z</dc:date>
    <item>
      <title>Warning with PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348005#M80528</link>
      <description>&lt;P&gt;This is mydata :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
input age note;
cards;
15  17.5
35  18
22  16.25
21  14.5
17  18.5
15 16
22 14.5
35 12.5
21 13.25
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and i want to compute note_Q1 and note_Q3 for each age. So I did :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro compute(age);
	%do i=1 %to &amp;amp;age;
			proc means data=mydata(where=(age=&amp;amp;i.)) q1 q3;
			var note;
			class age;
			ods output summary=data_&amp;amp;i.;
			run;

	%end;
%mend;

%compute(35);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but i get this warning message :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: There were 0 observations read from the data set WORK.MYDATA.
      WHERE age=1;

WARNING: Output 'summary' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
         verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
         the NOPRINT option is not used.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I get only on table with proc means result by age ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 08:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348005#M80528</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-07T08:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Warning with PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348009#M80531</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets start from fresh here, what is it your trying to achieve - post some example output. &amp;nbsp;Its never a good idea to jump into macro programming when its not fully understood. &amp;nbsp;What your macro is doing is repeating that proc means code for every number between 1 and &amp;amp;age. &amp;nbsp;So in the example it does:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;means&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;mydata&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;age&lt;SPAN class="token operator"&gt;=1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; q1 q3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will return 0 observations&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;means&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;mydata&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;age&lt;SPAN class="token operator"&gt;=2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; q1 q3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Which will return 0 observations etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really can't state this clearly enough, macro is not a) a simple tool, b) not to be used to replace base SAS programming. &amp;nbsp;Anything you want to do can be done in base SAS, so don't complicate your thinking by macro'ing it. &amp;nbsp;Post example requirements for further help.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 08:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348009#M80531</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-07T08:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Warning with PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348013#M80533</link>
      <description>&lt;P&gt;Thanks. But how can i compute Q1 and Q3 since I dont have 1 to 35 but 15 to 35 ? (and its not 15, 16, 17, ... 35) ? I mean &lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;compute for each occurrence of age &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 08:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348013#M80533</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-07T08:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Warning with PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348026#M80541</link>
      <description>&lt;P&gt;Well, your by group in that instance will be age so (note not tested as have no test data);&lt;/P&gt;
&lt;PRE&gt;proc sort data=have;
  by age;
run;

proc means data=have;
  by age;
  var note;
  output out=want q1=q1 q3=q3;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Apr 2017 08:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Warning-with-PROC-MEANS/m-p/348026#M80541</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-07T08:58:38Z</dc:date>
    </item>
  </channel>
</rss>

