<?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 Proc tabulate problem? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77969#M22507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if you could help me on this please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to produce a table using the attahced data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the follwing code and generated a table close to what I wanted but needs some changes in the order of headings.&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;tabulate&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=a.book3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; prior_arrears_band;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; arrears_band;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; balance;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; prior_arrears_band, arrears_band*(N balance*SUM); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;This is the table produced. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 576px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl29" height="72" rowspan="4" style="border-bottom: #333333 1pt solid;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl32" colspan="8" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="512"&gt;Arrears_Band&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl32" colspan="2" height="18" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;30 - 60&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl32" colspan="2" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;60 - 90&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl32" colspan="2" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;Current&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl32" colspan="2" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;NPNA&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl35" height="36" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;TD class="xl35" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;TD class="xl35" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;TD class="xl35" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="18" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="52" style="border-top: medium none;" width="64"&gt;&lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD class="xl37" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;800&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl40" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl25" height="18" style="TEXT-ALIGN: left; BORDER-TOP: medium none;" width="64"&gt;&lt;STRONG style="color: #0000ff;"&gt;1 - 30&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="22" style="border-top: medium none;" width="64"&gt;&lt;STRONG style="color: #0000ff;"&gt;Current&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl24"&gt;1&lt;/TD&gt;&lt;TD class="xl24"&gt;555&lt;/TD&gt;&lt;TD class="xl24"&gt;.&lt;/TD&gt;&lt;TD class="xl24"&gt;.&lt;/TD&gt;&lt;TD class="xl24"&gt;2&lt;/TD&gt;&lt;TD class="xl24"&gt;1571&lt;/TD&gt;&lt;TD class="xl24"&gt;.&lt;/TD&gt;&lt;TD class="xl26"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="22" style="border-top: medium none;" width="64"&gt;&lt;STRONG style="color: #0000ff;"&gt;NPNA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;1&lt;/TD&gt;&lt;TD class="xl28"&gt;700&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;i) In the horizontal headings (colored in red) I need the order like this: Current, 30 - 60, 60-90, NPNA&lt;/P&gt;&lt;P&gt;ii) In the vertical headings (colred in blue) I need the order: Current, 1 -30, NPNA&lt;/P&gt;&lt;P&gt;iii). The heading &lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band &lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;has to be lying vertically down at the very left extreme of the table (becuase this corss tab is between &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band and Arrears_Band)&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Could anyone please help me to tweak the proc tabulate code?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Mirisage &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 17:46:50 GMT</pubDate>
    <dc:creator>Mirisage</dc:creator>
    <dc:date>2012-09-26T17:46:50Z</dc:date>
    <item>
      <title>Proc tabulate problem?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77969#M22507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if you could help me on this please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to produce a table using the attahced data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the follwing code and generated a table close to what I wanted but needs some changes in the order of headings.&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;tabulate&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=a.book3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; prior_arrears_band;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; arrears_band;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; balance;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; prior_arrears_band, arrears_band*(N balance*SUM); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;This is the table produced. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 576px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl29" height="72" rowspan="4" style="border-bottom: #333333 1pt solid;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl32" colspan="8" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="512"&gt;Arrears_Band&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl32" colspan="2" height="18" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;30 - 60&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl32" colspan="2" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;60 - 90&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl32" colspan="2" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;Current&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl32" colspan="2" style="TEXT-ALIGN: center; BORDER-LEFT: medium none; BORDER-RIGHT: #333333 1pt solid;" width="128"&gt;&lt;STRONG style="color: #ff0000;"&gt;NPNA&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl35" height="36" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;TD class="xl35" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;TD class="xl35" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;TD class="xl35" rowspan="2" style="border-bottom: #333333 1pt solid; border-top: medium none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Balance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="18" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;TD class="xl22" style="border-left: medium none; border-top: medium none;" width="64"&gt;Sum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="52" style="border-top: medium none;" width="64"&gt;&lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD class="xl37" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;800&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl39" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;TD class="xl40" rowspan="2" style="border-top: medium none;"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl25" height="18" style="TEXT-ALIGN: left; BORDER-TOP: medium none;" width="64"&gt;&lt;STRONG style="color: #0000ff;"&gt;1 - 30&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="22" style="border-top: medium none;" width="64"&gt;&lt;STRONG style="color: #0000ff;"&gt;Current&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl24"&gt;1&lt;/TD&gt;&lt;TD class="xl24"&gt;555&lt;/TD&gt;&lt;TD class="xl24"&gt;.&lt;/TD&gt;&lt;TD class="xl24"&gt;.&lt;/TD&gt;&lt;TD class="xl24"&gt;2&lt;/TD&gt;&lt;TD class="xl24"&gt;1571&lt;/TD&gt;&lt;TD class="xl24"&gt;.&lt;/TD&gt;&lt;TD class="xl26"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="22" style="border-top: medium none;" width="64"&gt;&lt;STRONG style="color: #0000ff;"&gt;NPNA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;.&lt;/TD&gt;&lt;TD class="xl27"&gt;1&lt;/TD&gt;&lt;TD class="xl28"&gt;700&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;i) In the horizontal headings (colored in red) I need the order like this: Current, 30 - 60, 60-90, NPNA&lt;/P&gt;&lt;P&gt;ii) In the vertical headings (colred in blue) I need the order: Current, 1 -30, NPNA&lt;/P&gt;&lt;P&gt;iii). The heading &lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band &lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;has to be lying vertically down at the very left extreme of the table (becuase this corss tab is between &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band and Arrears_Band)&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Could anyone please help me to tweak the proc tabulate code?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Mirisage &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 17:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77969#M22507</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-09-26T17:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate problem?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77970#M22508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i) In the horizontal headings (colored in red) I need the order like this: Current, 30 - 60, 60-90, NPNA&lt;/P&gt;&lt;P&gt;ii) In the vertical headings (colred in blue) I need the order: Current, 1 -30, NPNA&lt;/P&gt;&lt;P&gt;The most consistent approach I've found for odd ordering is to create a new numeric variable and create a custom format with values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iii). The heading &lt;EM&gt;&lt;STRONG style="color: #008000;"&gt;prior_arrears_band &lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;has to be lying vertically down at the very left extreme of the table &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I don't think it is possible to get vertical text the way you are thinking with tabulate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can generate label to the left using a different&amp;nbsp; variable, for exam prior_label whose value or format is always prior_arrears_band, though I would make it more language in appearance than variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then add the prior_label variable to the class statement and table statement would look something like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; prior_label=''*prior_arrears_band='', arrears_band*(N balance*SUM); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;The ='' suppresses the label or variable name from appearing for that variable in the table output.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively use prior_arrears_band='', arrears_band*(n balance*sum)/ box=prior_arrears_band; to have that label as the column heading instead of as it appears currently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77970#M22508</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-09-26T21:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate problem?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77971#M22509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give you an example .&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 x;
input a $ b $ x;
cards;
NPNA&amp;nbsp;&amp;nbsp; 30-60&amp;nbsp;&amp;nbsp; 1
Current&amp;nbsp; 30-60&amp;nbsp;&amp;nbsp; 1
1-30&amp;nbsp;&amp;nbsp; 60-90&amp;nbsp; 1
NPNA&amp;nbsp;&amp;nbsp; NPNA&amp;nbsp;&amp;nbsp; 1 
1-30&amp;nbsp;&amp;nbsp; Current&amp;nbsp;&amp;nbsp; 1 
;
run;
proc format ;
value $ fmt(default=20)
&amp;nbsp; 'Current'='&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Current'
&amp;nbsp; '1-30'='&amp;nbsp;&amp;nbsp; 1-30'
&amp;nbsp; '30-60'='&amp;nbsp; 30-60'
&amp;nbsp; '60-90'=' 60-90'
&amp;nbsp; 'NPNA'='NPNA'
&amp;nbsp; ;
run;
proc tabulate data=x order=formatted;
class a b;
format a b $fmt.;
var x;
table a,b*x;
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;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 02:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77971#M22509</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-09-27T02:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate problem?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77972#M22510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ballardw and Ksharp,&lt;/P&gt;&lt;P&gt;Many thanks to both of you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Ballardw&lt;/P&gt;&lt;P&gt;I appplied your second suggestion (highlighted in yellow color in the following code). It works. thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;Many thanks for taking time to provide an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I applied your "proc format" suggestion (please see belwo). But still the order of catelgorical columns are not coming in the order defined in proc format. Is there any problem in my proc format code or proc tabulate code? Also i saw you have intentionally leaft some space &lt;SPAN lang="EN" style="background: lime; color: #575757;"&gt;'1-30'='&amp;nbsp;&amp;nbsp; 1-30'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 11pt;"&gt;/*Format $ fmt. will be used in tabulate and will control the order in which the categorical &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp; columns are laid out*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;format&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; $ fmt(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;multilabel&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;notsorted&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 11pt;"&gt;/*See note below */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'Current'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'Current'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'1-30'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'1-30'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'30-60'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'30-60'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'60-90'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'60-90'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'NPNA'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'NPNA'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;tabulate&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=book3 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;order&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=formatted;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; prior_arrears_band;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; arrears_band /&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: blue; font-size: 11pt;"&gt;PRELOADFMT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: lime; color: blue; font-size: 11pt;"&gt;order&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: blue; font-size: 11pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; balance;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: yellow; color: blue; font-size: 11pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: yellow; color: black; font-size: 11pt;"&gt; prior_arrears_band=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: yellow; color: purple; font-size: 11pt;"&gt;''&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: yellow; color: black; font-size: 11pt;"&gt;, arrears_band*(n balance*sum)/ &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: yellow; color: blue; font-size: 11pt;"&gt;box&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: yellow; color: black; font-size: 11pt;"&gt;=prior_arrears_band;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: blue; font-size: 11pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: black; font-size: 11pt;"&gt; arrears_band &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: teal; font-size: 11pt;"&gt;$fmt.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: lime; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;/*Note: from literature: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Notsorted" option maintains the sort order as specified in the format and can be used in conjunction with the multilabel format option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 15:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77972#M22510</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-09-27T15:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate problem?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77973#M22511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;'1-30' = ' 1-30'&amp;nbsp; /* add a space as &amp;lt;space&amp;gt;1 will usually sort before 30.&lt;/P&gt;&lt;P&gt;for your example. One reason I recommended a numeric variable was to avoid using the formatted value as the formatted values are going to get sorted using your systems collating sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the "notsorted" option seems to be problematic for maintaining order depending on procedure and options used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 16:48:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77973#M22511</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-09-27T16:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate problem?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77974#M22512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ballardw,&lt;/P&gt;&lt;P&gt;The reason why the catelgorical columns are not coming in the order defined in proc format is becasue I have not defined them as exactly as appeard in the data set values (Thanks to Joe Matise for spotting this).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;Incorrect&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'1-30'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'1-30'&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;correct (see the space up)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'1 - 30'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 11pt;"&gt;'1-30'&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 17:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-problem/m-p/77974#M22512</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-09-28T17:05:32Z</dc:date>
    </item>
  </channel>
</rss>

