<?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: How to output Proc Means output to a macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61949#M13480</link>
    <description>I agree with the other posters.  A very (very) slight improvement would be to avoid outputting the median data set again, as in:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set tmp_median_aaa;&lt;BR /&gt;
call symputx('tmp_median_aaa', tmp_median_aaa);&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 10 Aug 2009 17:17:41 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-08-10T17:17:41Z</dc:date>
    <item>
      <title>How to output Proc Means output to a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61946#M13477</link>
      <description>I want to generate the median of a variable, and I understand that PROC SQL is only capable of calc median horizontally and not vertically.  Now my question is, if I use proc means, is there a way to output the median to a macro variable? I'm hoping to find a more code-efficient way instead of having to write another datastep to call symput to a macro variable.&lt;BR /&gt;
&lt;BR /&gt;
my current code:&lt;BR /&gt;
proc means data=tmp_aaa noprint;&lt;BR /&gt;
	var pvol;&lt;BR /&gt;
	output out=tmp_median_aaa median=tmp_median_aaa;&lt;BR /&gt;
	;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data tmp_median_aaa;&lt;BR /&gt;
	set tmp_median_aaa;&lt;BR /&gt;
	call symput('tmp_median_aaa', tmp_median_aaa);&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 06 Aug 2009 06:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61946#M13477</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-06T06:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to output Proc Means output to a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61947#M13478</link>
      <description>Hello.&lt;BR /&gt;
&lt;BR /&gt;
From my knowledge this is the most efficient way of doing this.&lt;BR /&gt;
&lt;BR /&gt;
You could use the SELECT INTO: feature of PROC SQL to populate a macro var after doing the necessary aggregation. But as you already pointed out, there is no support for MEDIAN(X) summary functions (vertically), just the common datastep MEDIAN function (horizontally).&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;.</description>
      <pubDate>Thu, 06 Aug 2009 07:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61947#M13478</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-08-06T07:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to output Proc Means output to a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61948#M13479</link>
      <description>I don't think there is a more "code efficient" way than using call symput. This is the way I do it.</description>
      <pubDate>Mon, 10 Aug 2009 14:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61948#M13479</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2009-08-10T14:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to output Proc Means output to a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61949#M13480</link>
      <description>I agree with the other posters.  A very (very) slight improvement would be to avoid outputting the median data set again, as in:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set tmp_median_aaa;&lt;BR /&gt;
call symputx('tmp_median_aaa', tmp_median_aaa);&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 10 Aug 2009 17:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-Proc-Means-output-to-a-macro-variable/m-p/61949#M13480</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-10T17:17:41Z</dc:date>
    </item>
  </channel>
</rss>

