<?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 report compute block in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697510#M33656</link>
    <description>&lt;P&gt;The usual answer: PROC REPORT is the wrong tool. Use the DATA step to manipulate data.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 06:16:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-09T06:16:52Z</dc:date>
    <item>
      <title>proc report compute block</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697506#M33653</link>
      <description>&lt;P&gt;Hi Guys Good Morning&lt;/P&gt;&lt;P&gt;I want to output F and&amp;nbsp; M&amp;nbsp; alternatively&amp;nbsp; sex in class dataset using proc report compute block&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
columns Name Sex ;
define Name ;
define sex
computer after Sex;
IF Sex='F'	
output;
IF Sex='M'
output;
end comp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Nov 2020 05:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697506#M33653</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-11-09T05:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc report compute block</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697507#M33654</link>
      <description>&lt;P&gt;How should that report look in the end?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 05:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697507#M33654</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-09T05:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc report compute block</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697508#M33655</link>
      <description>run below code want output same in proc report&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data dsn (keep =Name sex);&lt;BR /&gt;set sashelp.class (where =(sex='F'));&lt;BR /&gt;output;&lt;BR /&gt;set sashelp.class (where =(sex='M'));&lt;BR /&gt;output;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Nov 2020 05:54:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697508#M33655</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-11-09T05:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc report compute block</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697510#M33656</link>
      <description>&lt;P&gt;The usual answer: PROC REPORT is the wrong tool. Use the DATA step to manipulate data.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 06:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697510#M33656</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-09T06:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc report compute block</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697604#M33657</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The first consideration is that PROC REPORT does NOT support the OUTPUT statement. OUTPUT is a statement that can only be used in a DATA step program. If you want to see Males and Females separately, either use BY group processing or use the PROC REPORT usage of GROUP in the DEFINE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here are some examples using SASHELP.CLASS and PROC REPORT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;** Example 1;
proc report data=sashelp.class;
  title '1) Using ORDER variables for detail report';
  column sex name age height weight;
  define sex / order;
  define name / display;
  define age / display;
  define height/ mean f=6.2;
  define weight / mean f=6.2;
  break after sex / summarize;
  compute after sex;
    line ' ';
  endcomp;
run;

** Example 2;
proc report data=sashelp.class;
  title '2) Using GROUP variables for summary report';
  column sex name age height weight;
  define sex / group;
  define age / group;
  define height/ mean f=6.2;
  define weight / mean f=6.2;
  break after sex / summarize;
  compute after sex;
    line ' ';
  endcomp;
run;

** Example 3;
proc report data=sashelp.class;
  title '3) Using ORDER variable and PAGE option for detail report';
  column sex name age height weight;
  define sex / order page;
  define name / display;
  define age / display;
  define height/ mean f=6.2;
  define weight / mean f=6.2;
  break after sex / summarize;
  compute after sex;
    line ' ';
  endcomp;
run;

** Example 4;
proc sort data=sashelp.class out=class;
  by sex name;
run;

proc report data=class;
  title '4) Using BY GROUP processing for detail report';
  column sex name age height weight;
  by sex;
  define name / order;
  define age / display;
  define height/ mean f=6.2;
  define weight / mean f=6.2;
  rbreak after / summarize;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 13:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-report-compute-block/m-p/697604#M33657</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-11-09T13:32:14Z</dc:date>
    </item>
  </channel>
</rss>

