<?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/96967#M27347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are getting the order you want WITHIN the market as market is the first column. Try switching the order of market and PCI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Feb 2013 15:37:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-02-04T15:37:47Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96966#M27346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having proc report issues and not sure why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table I am trying to do a proc report output html and it is just not working. The column in question is pri_drg_count and it is a number type with 8 in length. My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html file='my path';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report nowd data=pci.ipall split='/';&lt;/P&gt;&lt;P&gt;title'Overall PCI';&lt;/P&gt;&lt;P&gt;columns maj_mkt_nm pci_drg_count mbr_count;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define maj_mkt_nm/group 'Market' missing;&lt;/P&gt;&lt;P&gt;define pci_drg_count/group order=freq descending 'PCI Count' center;&lt;/P&gt;&lt;P&gt;define mbr_count/no print&lt;/P&gt;&lt;P&gt;define perc1/computed format=percent10.2 'PCI Percent' center missing;&lt;/P&gt;&lt;P&gt;compute perc1;&lt;/P&gt;&lt;P&gt;perc1=_c2_/_c3_;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The out put everytime is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;market&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pci_count&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent&lt;/P&gt;&lt;P&gt;alabama&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;georgia&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 400&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;texas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;nyc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need it to be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;market&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pci_count&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent&lt;/P&gt;&lt;P&gt;nyc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;georgia&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 400&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;texas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;alabama&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE NOTE, THE CODE RUNS FINE, NO ERRORS, THE % ACTUALLY DISPLAYS THE %, IT IS JUST I HAVE THIS CODE ON WORK COMPUTER AND TYPING FROM LOOKING AT THE SCREEN ONTO MY PERSONAL COMPUTER SCREEN SO IF I MISSED SOMETHING MY QUESTION IS NOT WHAT I AM MISSING IN THE CODE OR TYPOS. MY PROBLEM IS SOLELY I CANNOT GET THE PCI_COUNT TO DESCEND.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96966#M27346</guid>
      <dc:creator>tmm</dc:creator>
      <dc:date>2013-02-04T15:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96967#M27347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are getting the order you want WITHIN the market as market is the first column. Try switching the order of market and PCI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96967#M27347</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-02-04T15:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96968#M27348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can switch them but then how would I them make Market appear in the first column?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96968#M27348</guid>
      <dc:creator>tmm</dc:creator>
      <dc:date>2013-02-04T15:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96969#M27349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get rid of setting up maj_mkt_nm as a GROUP variable. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96969#M27349</guid>
      <dc:creator>Data_Detective_23219</dc:creator>
      <dc:date>2013-02-04T15:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96970#M27350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ugh. That did not work. I might just have to not bother with it as I have been trying to figure this out all weekend and I really need to get on with the rest of the code. I might just throw it into Excel and then descend in the sheet because I have researched so many books and sites and cannot find an answer. Just spending far too much time on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96970#M27350</guid>
      <dc:creator>tmm</dc:creator>
      <dc:date>2013-02-04T15:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96971#M27351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try then changing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define pci_drg_count/group order=freq descending 'PCI Count' center;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define pci_drg_count/order&amp;nbsp; order=freq descending 'PCI Count' center;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96971#M27351</guid>
      <dc:creator>Data_Detective_23219</dc:creator>
      <dc:date>2013-02-04T15:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96972#M27352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks, but I tried that earlier and it did not work. Just tried it again and it does not work. I am on SAS 9.2 so perhaps there is a different format I need. I am just going on to the rest of the code and if I figure it out sometime I will post what I had to do. Otherwise I will just export to excel and sort. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 16:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96972#M27352</guid>
      <dc:creator>tmm</dc:creator>
      <dc:date>2013-02-04T16:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96973#M27353</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; It really depends on whether your data are already summarized or not. If pci_drg_count is already a summary number, then you can use it to order your rows. It would have to appear before maj_mkt_nm, though, because, ordering happens from left to right on the report row, so once ALABAMA is the first row, you have no opportunity to "reorder" based on pci_drg_count. The code below shows you how to put pci_drg_first for ordering (just use ORDER DESCENDING) and then once you understand how it's working, you can use NOPRINT on the first column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; There is no need to use ABSOLUTE column numbers such as _C2_ and _C3_ for this report, because you don't have any across variables, so using the report item names will work just fine. For mbr_count, the usage is SUM, so you have to use the variable.statistic reference method in the COMPUTE block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The report item PDC is an alias for PCI_DRG_COUNT .. you use the "regular" variable name to control ordering and then you make an alias for that variable so you can refer to it by the simple name in the COMPUTE block and so that it can still&amp;nbsp; appear "after" maj_mkt_nm, essentially being used twice on the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If the data are NOT already summarized, then you would have to use a different technique. But since you did not show any of the original data and since you used PCI_DRG_COUNT as GROUP, implying that it was already summarized, I just made some summarized "fake" data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;STRONG style="font-family: Courier New;"&gt;*make some fake, pre-summarized data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data ipall;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; infile datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; input maj_mkt_nm $ pci_drg_count mbr_count;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;return;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;alabama&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp; 24&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;georgia&amp;nbsp; 400&amp;nbsp; 800&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;texas&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&amp;nbsp; 450&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;nyc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp; 750&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\order_desc.html';&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report nowd data=ipall split='/' nowd;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title'Overall PCI';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;columns&amp;nbsp; pci_drg_count maj_mkt_nm pci_drg_count=pdc mbr_count perc1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define pci_drg_count / order descending 'PCI for ordering' /* noprint */;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define maj_mkt_nm/order 'Market' missing;&lt;/STRONG&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define mbr_count/ analysis sum /* noprint */;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define pdc / order 'PCI Count';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define perc1/computed format=percent10.2 'PCI Percent' center missing;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;compute perc1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** use column names instead of absolute numbers;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** since you pci_drg_count for noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;perc1=pdc/mbr_count.sum;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;endcomp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 03:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/96973#M27353</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-02-06T03:04:23Z</dc:date>
    </item>
  </channel>
</rss>

