<?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: Sum in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158044#M41353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL can give you less code and faster speed . I am about to make a paper about this when you are building a report .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;

data office;
&amp;nbsp;&amp;nbsp; infile cards expandtabs; 
&amp;nbsp;&amp;nbsp; input (ID&amp;nbsp; RACE&amp;nbsp; GENDER&amp;nbsp;&amp;nbsp; PMT_TYPE ICD&amp;nbsp;&amp;nbsp; VISIT OFFICE)($);
&amp;nbsp;&amp;nbsp; cards; 
AA H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
AB H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
AC H&amp;nbsp; M&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
AD H&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; IN 9
BA H&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
BB H&amp;nbsp; F&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
BC H&amp;nbsp; F&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
BD H&amp;nbsp; F&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; IN 9
CA W&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
CB W&amp;nbsp; M&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
CC W&amp;nbsp; M&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
CD W&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
CD W&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
DA W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
DB W&amp;nbsp; F&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
DC W&amp;nbsp; F&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
DD W&amp;nbsp; F&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
ZA H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 8
ZB W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 8
ZC W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 8
;;;;
&amp;nbsp;&amp;nbsp; run;

proc sql;
 create table temp as
&amp;nbsp; select office,race,gender,PMT_TYPE as type ,count(*) as n 
&amp;nbsp;&amp;nbsp; from office
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by office,race,gender,PMT_TYPE
 union
&amp;nbsp; select office,race,gender,ICD as type ,count(*) as n 
&amp;nbsp;&amp;nbsp; from office
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by office,race,gender,ICD
 union
&amp;nbsp; select office,race,gender,VISIT as type ,count(*) as n 
&amp;nbsp;&amp;nbsp; from office
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by office,race,gender,VISIT ;
quit;
proc transpose data=temp out=temp1(drop=_:);
 by&amp;nbsp; office race gender&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;
 id type;
 var n;
run;
proc stdize data=temp1 out=want missing=0 reponly;run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Dec 2014 13:26:41 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-12-20T13:26:41Z</dc:date>
    <item>
      <title>Sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158039#M41348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to add individual records and roll up to office, regional and state levels.&amp;nbsp; I was producing multiple table frequencies but the totals are appearing on the right hand side when I am wanting the totals to be within the table.&amp;nbsp; My data looks like this and I've also included my desired results.&amp;nbsp;&amp;nbsp; The regional level rows are the sums of individual office levels.&amp;nbsp;&amp;nbsp; Any help would be appreciated.&amp;nbsp;&amp;nbsp; Thank you.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 491px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;RACE&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="87"&gt;GENDER&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="84"&gt;PMT_TYPE&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;ICD&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;VISIT&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;OFFICE&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AA&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AB&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;FFS&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;AD&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;MC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;BA&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;BB&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;FFS&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;BC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;PPO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;BD&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;MC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CB&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;FFS&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;PPO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CD&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;MC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;CD&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;MC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;DA&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;DB&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;FFS&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;DC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;PPO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;DD&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;MC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;9&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;ZA&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;ZB&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;ZC&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;8&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="703"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl70" colspan="10" height="20" style="border-right-color: black; border-right-width: 0.5pt; border-right-style: solid;" width="703"&gt;Desired output: &lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;LEVEL&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;RACE&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;GENDER&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;HMO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;FFS&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;PPO&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;MC&lt;/TD&gt;&lt;TD class="xl67" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;ICD290&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;IN-VISIT&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;OUT-VISIT&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;OFFICE9&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;OFFICE9&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;OFFICE9&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl68" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;OFFICE9&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl69" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl68" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;OFFICE8&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl69" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl68" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;OFFICE8&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl69" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="47" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;REGION&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;REGION&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;H&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;REGION&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;M&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;REGION&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;W&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;F&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;6&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;4&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 18:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158039#M41348</guid>
      <dc:creator>BaileyY</dc:creator>
      <dc:date>2014-12-19T18:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158040#M41349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is close.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; office;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;expandtabs&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (ID&amp;nbsp; RACE&amp;nbsp; GENDER&amp;nbsp;&amp;nbsp; PMT_TYPE ICD&amp;nbsp;&amp;nbsp; VISIT OFFICE)($);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;AA H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;AB H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;AC H&amp;nbsp; M&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;AD H&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;BA H&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;BB H&amp;nbsp; F&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;BC H&amp;nbsp; F&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;BD H&amp;nbsp; F&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;CA W&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;CB W&amp;nbsp; M&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;CC W&amp;nbsp; M&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;CD W&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;CD W&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;DA W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;DB W&amp;nbsp; F&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9&lt;BR /&gt;DC W&amp;nbsp; F&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;DD W&amp;nbsp; F&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;ZA H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 8&lt;BR /&gt;ZB W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 8&lt;BR /&gt;ZC W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 8&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;options&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;missing&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;report&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;nowd&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;list&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;columns&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; office race gender pmt_type icd visit;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; office / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;descending&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; race / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;group&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; gender / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;descending&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; pmt_type / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;across&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;order&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=data;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; icd / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;across&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; visit / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;across&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;IMG alt="12-19-2014 2-36-52 PM.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/8527_12-19-2014 2-36-52 PM.png" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 20:38:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158040#M41349</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-12-19T20:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158041#M41350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input ID $ RACE $ GENDER $ PMT_TYPE $ ICD $ VISIT $ OFFICE $;&lt;BR /&gt;office=cats('OFFICE',office);&lt;BR /&gt;cards;&lt;BR /&gt;AA H M HMO 290 IN 9&lt;BR /&gt;AB H M HMO 290 OUT 9&lt;BR /&gt;AC H M FFS 290 IN 9&lt;BR /&gt;AD H M MC 290 IN 9&lt;BR /&gt;BA H F HMO 290 OUT 9&lt;BR /&gt;BB H F FFS 290 IN 9&lt;BR /&gt;BC H F PPO 290 IN 9&lt;BR /&gt;BD H F MC 290 IN 9&lt;BR /&gt;CA W M HMO 290 OUT 9&lt;BR /&gt;CB W M FFS 290 IN 9&lt;BR /&gt;CC W M PPO 290 IN 9&lt;BR /&gt;CD W M MC 290 OUT 9&lt;BR /&gt;CD W M MC 290 OUT 9&lt;BR /&gt;DA W F HMO 290 OUT 9&lt;BR /&gt;DB W F FFS 290 IN 9&lt;BR /&gt;DC W F PPO 290 OUT 9&lt;BR /&gt;DD W F MC 290 OUT 9&lt;BR /&gt;ZA H M HMO 290 IN 8&lt;BR /&gt;ZB W F HMO 290 IN 8&lt;BR /&gt;ZC W F HMO 290 OUT 8&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;options missing=0; &lt;BR /&gt;proc freq data=have noprint;&lt;BR /&gt;&amp;nbsp; tables office*race*gender*pmt_type / out=freq_pmt nopercent;&lt;BR /&gt;&amp;nbsp; tables office*race*gender*icd / out=freq_icd nopercent;&lt;BR /&gt;&amp;nbsp; tables office*race*gender*visit / out=freq_visit nopercent;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=freq_pmt out=trans_pmt(drop=_name_ _Label_);&lt;BR /&gt;&amp;nbsp; by office race gender;&lt;BR /&gt;&amp;nbsp; id pmt_type;&lt;BR /&gt;&amp;nbsp; var count;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=freq_icd out=trans_icd(drop=_name_ _Label_) prefix=ICD;&lt;BR /&gt;&amp;nbsp; by office race gender;&lt;BR /&gt;&amp;nbsp; id icd;&lt;BR /&gt;&amp;nbsp; var count;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=freq_visit out=trans_visit(drop=_name_ _Label_) suffix=_VISIT;&lt;BR /&gt;&amp;nbsp; by office race gender;&lt;BR /&gt;&amp;nbsp; id visit;&lt;BR /&gt;&amp;nbsp; var count;&lt;BR /&gt;run;&lt;BR /&gt;data want;&lt;BR /&gt;&amp;nbsp; merge trans_pmt trans_icd trans_visit;&lt;BR /&gt;&amp;nbsp; by office race gender;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CTorres&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 21:19:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158041#M41350</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-12-19T21:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158042#M41351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A solution is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct 'SUM(pmt_type='||''''||strip(pmt_type)||''''||') as '||pmt_type into :p_type separated by ',' from have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct 'SUM(ICD='||''''||strip(ICD)||''''||') as '||COMPRESS('ICD'||ICD) into :i_type separated by ',' from have;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct 'SUM(VISIT='||''''||strip(VISIT)||''''||') as '||COMPRESS(''''||VISIT||'-VISIT''n') into :v_type separated by ',' from have;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want(rename=(off=office)) as&lt;BR /&gt;&amp;nbsp; select compress('Office'||put(office,2.)) as off, race, gender,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;p_type , &amp;amp;i_type , &amp;amp;v_type&lt;BR /&gt;&amp;nbsp; from have&lt;BR /&gt;&amp;nbsp; group by office, race, gender&lt;BR /&gt;&amp;nbsp; order by office desc, race, gender desc;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; create table want2 as&lt;BR /&gt;&amp;nbsp; select 'REGION' as office, race, gender,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;p_type , &amp;amp;i_type , &amp;amp;v_type&lt;BR /&gt;&amp;nbsp; from have&lt;BR /&gt;&amp;nbsp; group by race, gender&lt;BR /&gt;&amp;nbsp; order by race, gender desc; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; insert into want select * from want2;&lt;BR /&gt;&amp;nbsp; drop table want2;&amp;nbsp; &lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 23:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158042#M41351</guid>
      <dc:creator>billfish</dc:creator>
      <dc:date>2014-12-19T23:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158043#M41352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you very much.&amp;nbsp; This produced a much closer output I was looking for.&amp;nbsp; Thank you!!! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 23:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158043#M41352</guid>
      <dc:creator>BaileyY</dc:creator>
      <dc:date>2014-12-19T23:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158044#M41353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL can give you less code and faster speed . I am about to make a paper about this when you are building a report .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;

data office;
&amp;nbsp;&amp;nbsp; infile cards expandtabs; 
&amp;nbsp;&amp;nbsp; input (ID&amp;nbsp; RACE&amp;nbsp; GENDER&amp;nbsp;&amp;nbsp; PMT_TYPE ICD&amp;nbsp;&amp;nbsp; VISIT OFFICE)($);
&amp;nbsp;&amp;nbsp; cards; 
AA H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
AB H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
AC H&amp;nbsp; M&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
AD H&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; IN 9
BA H&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
BB H&amp;nbsp; F&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
BC H&amp;nbsp; F&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
BD H&amp;nbsp; F&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; IN 9
CA W&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
CB W&amp;nbsp; M&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
CC W&amp;nbsp; M&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
CD W&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
CD W&amp;nbsp; M&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
DA W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
DB W&amp;nbsp; F&amp;nbsp; FFS&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 9
DC W&amp;nbsp; F&amp;nbsp; PPO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
DD W&amp;nbsp; F&amp;nbsp; MC 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 9
ZA H&amp;nbsp; M&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 8
ZB W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; IN 8
ZC W&amp;nbsp; F&amp;nbsp; HMO&amp;nbsp;&amp;nbsp; 290&amp;nbsp;&amp;nbsp; OUT&amp;nbsp;&amp;nbsp; 8
;;;;
&amp;nbsp;&amp;nbsp; run;

proc sql;
 create table temp as
&amp;nbsp; select office,race,gender,PMT_TYPE as type ,count(*) as n 
&amp;nbsp;&amp;nbsp; from office
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by office,race,gender,PMT_TYPE
 union
&amp;nbsp; select office,race,gender,ICD as type ,count(*) as n 
&amp;nbsp;&amp;nbsp; from office
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by office,race,gender,ICD
 union
&amp;nbsp; select office,race,gender,VISIT as type ,count(*) as n 
&amp;nbsp;&amp;nbsp; from office
&amp;nbsp;&amp;nbsp;&amp;nbsp; group by office,race,gender,VISIT ;
quit;
proc transpose data=temp out=temp1(drop=_:);
 by&amp;nbsp; office race gender&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;
 id type;
 var n;
run;
proc stdize data=temp1 out=want missing=0 reponly;run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 13:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum/m-p/158044#M41353</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-20T13:26:41Z</dc:date>
    </item>
  </channel>
</rss>

