<?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: Print output is different to data output for proc summary in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804066#M40453</link>
    <description>&lt;P&gt;Copy and Paste what?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 14:11:43 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-25T14:11:43Z</dc:date>
    <item>
      <title>Print output is different to data output for proc summary</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/803982#M40444</link>
      <description>&lt;P&gt;I'm using proc summary to calculate some quintiles, and I'm trying to get it in an output so it's easier to copy and paste across.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc summary data=example min q1 median q3 max print;
var variable_1 variable_2;
output out=example_quintiles;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I ran that and get the results in the format I want printed&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 562px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69770i48876772F7A5A211/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However I get something completely different in the output data, which makes it more difficult to copy and paste.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 487px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69771iCB4CC8AE17B9478A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 06:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/803982#M40444</guid>
      <dc:creator>dtha2622</dc:creator>
      <dc:date>2022-03-25T06:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Print output is different to data output for proc summary</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804001#M40445</link>
      <description>&lt;P&gt;Sadly, the default OUTPUT structure does not honor the statistics set in the PROC MEANS statement, so we need to beat the output into shape:&lt;/P&gt;
&lt;P&gt;(using SASHELP.CLASS as an example)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class min q1 median q3 max print;
var height weight;
output out=summary min= q1= median= q3= max= / autoname;
run;

proc transpose
  data=summary
  out=long1
;
var height: weight:;
run;

data long2;
set long1;
varname = scan(_name_,1,"_");
stat = scan(_name_,2,"_");
run;

proc transpose
  data=long2
  out=want (drop=_name_)
;
by varname;
var col1;
id stat;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 08:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804001#M40445</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T08:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Print output is different to data output for proc summary</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804050#M40452</link>
      <description>&lt;P&gt;You can use ODS and the STACKODS PROC statement option to get this data directly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select none;
proc summary data=sashelp.class min q1 median q3 max print stackods;
   var height weight;
   ods output summary=summary;
   run;
ods select all;
proc print data=summary;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 411px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69781i3C578D782D1E878F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sadly, the default OUTPUT structure does not honor the statistics set in the PROC MEANS statement, so we need to beat the output into shape:&lt;/P&gt;
&lt;P&gt;(using SASHELP.CLASS as an example)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class min q1 median q3 max print;
var height weight;
output out=summary min= q1= median= q3= max= / autoname;
run;

proc transpose
  data=summary
  out=long1
;
var height: weight:;
run;

data long2;
set long1;
varname = scan(_name_,1,"_");
stat = scan(_name_,2,"_");
run;

proc transpose
  data=long2
  out=want (drop=_name_)
;
by varname;
var col1;
id stat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 13:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804050#M40452</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-03-25T13:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Print output is different to data output for proc summary</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804066#M40453</link>
      <description>&lt;P&gt;Copy and Paste what?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 14:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Print-output-is-different-to-data-output-for-proc-summary/m-p/804066#M40453</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-25T14:11:43Z</dc:date>
    </item>
  </channel>
</rss>

