<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370259#M65091</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc format;
value gender
1='male'
2='femal';
run;

 

DATA have;
input group id sex ;
format sex gender.;
datalines;
1 133 1
3 134 1
;
run;

proc report data=have nowd;
define group/display;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 24 Jun 2017 12:40:54 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-06-24T12:40:54Z</dc:date>
    <item>
      <title>Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370207#M65086</link>
      <description>&lt;P&gt;I have a sas datsset create as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;value&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; gender&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=male &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=femal;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; group id sex ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sex &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;gender.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;1 133 1&lt;/P&gt;&lt;P&gt;3 134 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;( sas dataset Have)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;obs group&amp;nbsp;&amp;nbsp; id&amp;nbsp;&amp;nbsp;&amp;nbsp; sex&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;133&amp;nbsp;&amp;nbsp; male&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 134&amp;nbsp;&amp;nbsp; male&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Then I run proc report code as below:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;proc report data=have; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;The output upexpect as below(colum total):&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;group id&amp;nbsp;&amp;nbsp; sex&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267&amp;nbsp; femal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;How can I fix this problem? it sounds because format&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thank&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2017 02:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370207#M65086</guid>
      <dc:creator>Defense</dc:creator>
      <dc:date>2017-06-24T02:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370208#M65087</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; You do not have any define statements in your PROC REPORT code. GROUP and ID variables are numeric and by default, numeric variables have a usage of SUM. So you have values of 1 and 3 in for your two rows, and 1+3 = 4. You have values of 133 and 134 for ID and 133+134 = 267.&lt;BR /&gt;&lt;BR /&gt;My suggestion is that you review the DEFINE statement. And, as an example of what you need to do, consider this code and output.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9820i9C6815B560501A11/image-size/original?v=1.0&amp;amp;px=-1" alt="report_usage_important.png" title="report_usage_important.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2017 02:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370208#M65087</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-06-24T02:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370210#M65088</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In my real datsset, there is one more character variable. I will try to use define/order optiom to see if it workd.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2017 02:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370210#M65088</guid>
      <dc:creator>Defense</dc:creator>
      <dc:date>2017-06-24T02:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370259#M65091</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc format;
value gender
1='male'
2='femal';
run;

 

DATA have;
input group id sex ;
format sex gender.;
datalines;
1 133 1
3 134 1
;
run;

proc report data=have nowd;
define group/display;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Jun 2017 12:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report/m-p/370259#M65091</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-06-24T12:40:54Z</dc:date>
    </item>
  </channel>
</rss>

