<?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 create this report classified by k in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86202#M9161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; What do you mean when you say, "classified by k" -- does that mean you want to see all the values for 'a' together and then all the values for 'b' together???? Then do you want to see X, Y and Z as totals for each value of K or do you want to see every individual row for K on the report????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for showing the program, but a bit more info is needed to understand what you want. I'm not sure what your comment "/* not work */" means -- usually, if you want to GROUP on K, you would list it first in the COLUMN statement. As suggested by Shiva, with a usage of DISPLAY for the variable X, you will not get collapsing or totals -- if X is numeric, then taking off the usage of DISPLAY will cause you to get summary numbers for X, Y and Z.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Did you run the modified code? Is it what you anticipated or wanted?&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2012 16:15:03 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2012-04-17T16:15:03Z</dc:date>
    <item>
      <title>how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86200#M9159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to create this report classified by k?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x y z k $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 2 3 a&lt;/P&gt;&lt;P&gt;1 1 3 a&lt;/P&gt;&lt;P&gt;5 2 3 a&lt;/P&gt;&lt;P&gt;0 3 5 a&lt;/P&gt;&lt;P&gt;3 1 3 b&lt;/P&gt;&lt;P&gt;1 3 3 b&lt;/P&gt;&lt;P&gt;1 3 5 b&lt;/P&gt;&lt;P&gt;0 1 3 b&lt;/P&gt;&lt;P&gt;6 5 3 b&lt;/P&gt;&lt;P&gt;1 0 3 b&lt;/P&gt;&lt;P&gt;4 2 5 a&lt;/P&gt;&lt;P&gt;1 4 3 a&lt;/P&gt;&lt;P&gt;0 1 3 a&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp file='H:\My Documents\total29.xls' style=sasweb&lt;/P&gt;&lt;P&gt;options(default_column_width="5,10,10"&amp;nbsp; )&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc report data=have nowd;&lt;/P&gt;&lt;P&gt;column x y z k;&lt;/P&gt;&lt;P&gt;define x/display;&lt;/P&gt;&lt;P&gt;define y/analysis sum;&lt;/P&gt;&lt;P&gt;define z/analysis mean;&lt;/P&gt;&lt;P&gt;define k/group ;/*not work*/&lt;/P&gt;&lt;P&gt;rbreak before/summarize;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 14:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86200#M9159</guid>
      <dc:creator>George_S</dc:creator>
      <dc:date>2012-04-17T14:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86201#M9160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=have nowd;&lt;/P&gt;&lt;P&gt;column x y z k;&lt;/P&gt;&lt;P&gt;define x/'x';&lt;/P&gt;&lt;P&gt;define y/analysis sum;&lt;/P&gt;&lt;P&gt;define z/analysis mean;&lt;/P&gt;&lt;P&gt;define k/group ;/*not work*/&lt;/P&gt;&lt;P&gt;rbreak before/summarize;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 14:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86201#M9160</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-04-17T14:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86202#M9161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; What do you mean when you say, "classified by k" -- does that mean you want to see all the values for 'a' together and then all the values for 'b' together???? Then do you want to see X, Y and Z as totals for each value of K or do you want to see every individual row for K on the report????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for showing the program, but a bit more info is needed to understand what you want. I'm not sure what your comment "/* not work */" means -- usually, if you want to GROUP on K, you would list it first in the COLUMN statement. As suggested by Shiva, with a usage of DISPLAY for the variable X, you will not get collapsing or totals -- if X is numeric, then taking off the usage of DISPLAY will cause you to get summary numbers for X, Y and Z.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Did you run the modified code? Is it what you anticipated or wanted?&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 16:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86202#M9161</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-04-17T16:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86203#M9162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Shivas and Cynthia!&lt;/P&gt;&lt;P&gt;the result of y and z is exact what I want,but x is just for display the original values but not for summation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data =have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out =want6&lt;BR /&gt;&amp;nbsp;&amp;nbsp; nowindows&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; column x y z k new1;&lt;BR /&gt;&amp;nbsp; define k / group ;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG style="text-decoration: underline;"&gt;&amp;nbsp; define x/ display ; /*This will cause problem,I want display all the X a, also I want the sum of y and z by k*/&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&amp;nbsp; define y / analysis sum ;&lt;BR /&gt;&amp;nbsp; define z / analysis sum ;&lt;BR /&gt;&amp;nbsp; define new1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; / computed ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define new2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; / computed ;&lt;BR /&gt;&amp;nbsp; compute new1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new1 = y.sum *k;&lt;BR /&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; rbreak before/summarize;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 16:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86203#M9162</guid>
      <dc:creator>George_S</dc:creator>
      <dc:date>2012-04-17T16:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86204#M9163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the output you required..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=have nowd;&lt;/P&gt;&lt;P&gt;column x (y, sum)(z, mean) k;&lt;/P&gt;&lt;P&gt;define x/'x'&amp;nbsp; display;&lt;/P&gt;&lt;P&gt;define y/display;&lt;/P&gt;&lt;P&gt;define z/display;&lt;/P&gt;&lt;P&gt;define k/group ;/*not work*/&lt;/P&gt;&lt;P&gt;rbreak before/summarize;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 16:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86204#M9163</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-04-17T16:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86205#M9164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; K is a character variable. I don't understand what you are trying with this statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute new1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; new1 = y.sum *k;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp&lt;/P&gt;&lt;P&gt;you can never multiply a number by a character value.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 18:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86205#M9164</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-04-17T18:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to create this report classified by k</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86206#M9165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi: Take a look at these two reports. Asking for the mean statistic for Z doesn't make sense if you are going to just DISPLAY all the values of X. For example, you have K=A and X=0 for two observations:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;x y z k&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;0 3 5 a&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;0 1 3 a&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what do you want to see for the MEAN statistic on the Z column the individual values of 5 and 3 or do you want to see one row with 5+3/2????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached screen shots -- using your data and different usages for K and X. If you want to show the MEAN only at the break, then that is possible using ORDER usage for K and X; but if you want the MEAN for every unique combination of K and X, then you should have GROUP usage for both K and X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11745i71E6F991EC6D5F03/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="k_x_group_correct.jpg" title="k_x_group_correct.jpg" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11746iF02F945F3C325648/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="k_x_order_correct.jpg" title="k_x_order_correct.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 15:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-create-this-report-classified-by-k/m-p/86206#M9165</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-04-18T15:03:18Z</dc:date>
    </item>
  </channel>
</rss>

