<?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: Using proc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572983#M161728</link>
    <description>&lt;P&gt;Thanks very much!&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 01:47:51 GMT</pubDate>
    <dc:creator>ChuksManuel</dc:creator>
    <dc:date>2019-07-12T01:47:51Z</dc:date>
    <item>
      <title>Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572926#M161704</link>
      <description>&lt;P&gt;Hello programmers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that i want to output using Proc report to print it but i ran into difficulties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want my final report in the format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variables (Tn)&amp;nbsp; &amp;nbsp;Sample Size (N)&amp;nbsp; &amp;nbsp;Mean(P)&amp;nbsp; &amp;nbsp;Standard Deviation (std)&amp;nbsp; &amp;nbsp;Count of Yeses (N x P)&amp;nbsp; &amp;nbsp;Percentages (Count / N x 100)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My codes are attached and any input would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data me;
input tc	Tn $	n	p	std;
datalines;
1	Angina	15050	0.2031	0.40234
2	Heartburn	15050	0.2297	0.42065
3	Sleepiness	15042	0.1735	0.3787
4	Exercise	15058	0.23	0.42083
5	Palpitation	14991	0.1512	0.35828
6	Any 15020	0.5214	0.49956
7	BMI	15063	25.3549	4.30121
; run;

proc report data= me headline headskip; 
title1 "Descriptive Statistics For Study Population";
column tn N Mean std count ; 
define Tn / group width=20 'Variables';
define N / group width=10 'Sample Size';
define P / group format=6.2 width=10 'Mean';
define std/group format=6.2 width=10 'Standard Deviation';
define count/group format=6.2 width=5 'Count of Yeses (N*P)';
define perctn/group format=6.2 width=5 'Percentages %(Count/N X 100)';
compute Count ;
count = N*P;
endcomp;
compute perctn ;
perctn = count/N;
endcomp ;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572926#M161704</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-11T20:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572930#M161706</link>
      <description>&lt;P&gt;Attached is the error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there no way i can compute Count and perctn and then include them in my final report table?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Count.JPG" style="width: 571px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30997iD0EFDA7E05ED6DB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Count.JPG" alt="Count.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572930#M161706</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-11T20:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572932#M161707</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define count/computed format= ... ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the future, we prefer SAS logs to appear as text, pasted into the window that appears when you click on the {i} icon.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572932#M161707</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-11T20:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572935#M161708</link>
      <description>&lt;P&gt;Thanks Paige.&lt;/P&gt;&lt;P&gt;It worked but it gave me the attached output.&lt;/P&gt;&lt;P&gt;Three questions that i want to ask.&lt;/P&gt;&lt;P&gt;1. Many of my variable names were cut off. What could be the cause?&lt;/P&gt;&lt;P&gt;2. I do not want the count of yeses and percentages for the BMI variable. How do i specially treat it (remove) them.&lt;/P&gt;&lt;P&gt;3. Is there a way i can use Options or ODS statement to put my proc report output in a nice font?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="des.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30998i824D19F744F33C28/image-size/large?v=v2&amp;amp;px=999" role="button" title="des.JPG" alt="des.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:37:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572935#M161708</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-11T20:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572945#M161709</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;1. Many of my variable names were cut off. What could be the cause? &amp;gt;&amp;gt; You need to specify a LENGTH statement where you read in the data. The default length of character variables is 8.&amp;lt;&amp;lt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. I do not want the count of yeses and percentages for the BMI variable. How do i specially treat it (remove) them.&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; You can code an IF statement in your COMPUTE block to test for the value which you want to have computed differently. There are many different examples of previous forum postings of using IF statements in a COMPUTE block. &amp;lt;&amp;lt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Is there a way i can use Options or ODS statement to put my proc report output in a nice font?&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;What do you consider a "nice" font? Try a different style using the STYLE= option. What is your destination of choice? &amp;lt;&amp;lt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 21:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572945#M161709</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-07-11T21:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572971#M161722</link>
      <description>&lt;P&gt;Please can you share a template?&lt;/P&gt;&lt;P&gt;I've done an if statement to no avail.&lt;/P&gt;&lt;P&gt;A link would be helpful too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 23:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572971#M161722</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-11T23:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572980#M161726</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's how I changed the DATA step:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="length.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31005i2A394EBADBA65934/image-size/large?v=v2&amp;amp;px=999" role="button" title="length.png" alt="length.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here's how I changed the PROC REPORT step.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="report_changes.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31006iD51FE632CE0D4F20/image-size/large?v=v2&amp;amp;px=999" role="button" title="report_changes.png" alt="report_changes.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your usage of GROUP did not makes sense, so I changed most of the usages other than COMPUTED and ORDER to simple DISPLAY, which is OK if you don't need any grand totals at the bottom of the report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 01:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572980#M161726</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-07-12T01:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572983#M161728</link>
      <description>&lt;P&gt;Thanks very much!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 01:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/572983#M161728</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-12T01:47:51Z</dc:date>
    </item>
  </channel>
</rss>

