<?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 New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601083#M16666</link>
    <description>&lt;P&gt;Or a different proc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=top25wvars nowd;
   class diag1ccs age_3cat;
   table diag1ccs=' ',
         all='All' age_3cat=' '
         /box='Top 25 CCS diagnoses' 
   ;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Nov 2019 20:27:26 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-11-01T20:27:26Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601048#M16664</link>
      <description>&lt;P&gt;I am trying to make a report that would look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;
&lt;P&gt;Top 25 diagnoses:&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;All&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;Age 0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;Ages 1-17&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;Ages 18+&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;
&lt;P&gt;Most frequent diagnosis&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;560000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;20000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;270000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;270000&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;
&lt;P&gt;Second most frequent diagnosis&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;500000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;
&lt;P&gt;…..&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;
&lt;P&gt;25&lt;SUP&gt;th&lt;/SUP&gt; most frequent diagnosis&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="125"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I have so far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="background-color: #ffffff;"&gt;proc report data=top25wvars nowd;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; column diag1ccs age_3cat;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; define diag1ccs / 'Top 25 CCS diagnoses' group style(header)={text_decoration=underline};&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; define age_3cat/ across;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="background-color: #ffffff;"&gt;What I haven't been able to figure out is how to get the "All" column into the table.&amp;nbsp; The "All" column would have the counts of the top 25 diagnoses (all, not broken out by age), in descending order with the most frequent diagnosis at the top to the least frequent diagnosis.&amp;nbsp; The column with "Top 25 CCS diagnoses" also needs to be in descending order from the most frequent diagnosis at the top to the least frequent diagnosis.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="background-color: #ffffff;"&gt;Thanks for your help.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 18:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601048#M16664</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-11-01T18:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601050#M16665</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; value $sex(notsorted multilabel) 'M','F'='All' 'M'='Male' 'F'='Female'; quit;
proc report data=sashelp.class list;
   columns age sex;
   define age / group;
   define sex / across f=$sex. preloadfmt mlf order=data;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 177px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33586i858E2AC02C5519B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 18:48:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601050#M16665</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-11-01T18:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601083#M16666</link>
      <description>&lt;P&gt;Or a different proc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=top25wvars nowd;
   class diag1ccs age_3cat;
   table diag1ccs=' ',
         all='All' age_3cat=' '
         /box='Top 25 CCS diagnoses' 
   ;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Nov 2019 20:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601083#M16666</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-01T20:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601087#M16667</link>
      <description>&lt;P&gt;This is great!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just need to get rid of the row with the "N"s, and get the diagnoses in order starting from most frequent to least frequent (according to the all column).&amp;nbsp; Do you know how to do that?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 20:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601087#M16667</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-11-01T20:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601095#M16668</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/74483"&gt;@hein68&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is great!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just need to get rid of the row with the "N"s, and get the diagnoses in order starting from most frequent to least frequent (according to the all column).&amp;nbsp; Do you know how to do that?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can suppress the statistic labels by explicitly listing the statistic and suppressing the label by:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=top25wvars nowd;
   class diag1ccs age_3cat;
   table diag1ccs=' ',
         (all='All' age_3cat=' ') * n=' '
         /box='Top 25 CCS diagnoses' 
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Without data I am going to guess that perhaps specifying the Order=freq for the diaglccs variable will work.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=top25wvars nowd;
   class diag1ccs / order=freq ;
   class age_3cat;
   table diag1ccs=' ',
         all='All' age_3cat=' '
         /box='Top 25 CCS diagnoses' 
   ;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Nov 2019 20:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601095#M16668</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-01T20:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601102#M16670</link>
      <description>&lt;P&gt;Your code at the top worked for suppressing the N row &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The part about getting the records in order resulted in an error message though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data is set up like this (see attachment).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601102#M16670</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-11-01T21:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601104#M16671</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/74483"&gt;@hein68&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Your code at the top worked for suppressing the N row &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The part about getting the records in order resulted in an error message though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data is set up like this (see attachment).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the actual code submitted and the error message. Run the code, go to the Log, copy code and message. In the forum open a code box using the forum's {I} icon and paste the text. You want to paste into a code box to preserve text formatting as the message windows here will reformat text and move things like indicators where an error was found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: I may misspell your variable names as I have no data to run the code against. So check that.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601104#M16671</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-01T21:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601106#M16673</link>
      <description>&lt;P&gt;Actually your code does exactly what I needed.&amp;nbsp; It must have been my mistake the first time I tried it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks VERY much!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-report/m-p/601106#M16673</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-11-01T21:32:44Z</dc:date>
    </item>
  </channel>
</rss>

