<?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 report using the calculated last row in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54114#M14974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, that takes care of #1, what about #2? What destination? and #3? The formula for the calculation of INDEX? &lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2012 22:54:36 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2012-02-15T22:54:36Z</dc:date>
    <item>
      <title>proc report using the calculated last row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54110#M14970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to generate a numeric summary table using proc report.&lt;/P&gt;&lt;P&gt;Here is the code I run and I have attached the data set I use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; table_generator(var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;PROC REPORT DATA= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&amp;amp;var NOWD&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;STYLE(header) = [FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;) JUST=CENTER FONT_WEIGHT=BOLD]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;STYLE(report) = [FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;1.8&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;) BORDERWIDTH=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;0.2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; CELLSPACING=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;0.1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; JUST=CENTER WIDTH=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;980&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;STYLE(column) = [FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;) JUST=CENTER]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;STYLE(summary)=[FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;2.5&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;) FONT_WEIGHT=BOLD];&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;COLUMN (&amp;amp;var _FREQ_ Consumer_Default p_c index Small_Business_Failure p_s _FREQ_=pct);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;DEFINE &amp;amp;var /ORDER &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;"&amp;amp;var"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;DEFINE _FREQ_ /ANALYSIS &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;"Frequency"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;comma10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;DEFINE pct /ANALYSIS PCTSUM &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;"Pop"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;percent6.1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;DEFINE p_c /COMPUTED &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;"p_c"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;percent6.1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;DEFINE index /COMPUTED &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;"index"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;comma10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;DEFINE p_s /COMPUTED &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;"P_s"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;percent6.1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;COMPUTE p_c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;p_c=Consumer_Default.sum/_FREQ_.sum;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;COMPUTE p_s;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;p_s=Small_Business_Failure.sum/_FREQ_.sum;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;COMPUTE AFTER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;amp;var = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;'Total'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;RBREAK AFTER /SUMMARIZE OL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: &amp;amp;quot;"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; line-height: 115%; font-family: &amp;amp;quot;Courier New&amp;amp;quot;"&gt;%&lt;STRONG&gt;&lt;EM&gt;table_generator&lt;/EM&gt;&lt;/STRONG&gt;(var=industry);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the code generates thef following table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE cellspacing="0" class="Table" style="font-weight: normal; font-size: xx-small; width: 980px; font-style: normal; font-family: Arial; border: #000000 0px solid;"&gt;&lt;THEAD&gt;&lt;TR&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;industry&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;Frequency&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;Consumer Default&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;p_c&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;index&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;Small Business Failure&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;P_s&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="font-weight: bold; font-size: x-small; vertical-align: middle; font-style: normal; font-family: Arial; text-align: center;"&gt;Pop&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Agriculture&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;10&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;2.9% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Construction&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;52&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;1.9% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;1.9% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;15% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Finance&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;41&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;7.3% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;12% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Manufacturing&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;34&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;8.8% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;9.8% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Retail&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;78&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;3.8% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;22% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Service&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;111&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;8&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;7.2% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.9% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;32% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Transportation&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;4&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;1.1% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Wholesale&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;18&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;17% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.0% &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="font-weight: normal; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;5.2% &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;Total&lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;348&lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;21&lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;6.0% &lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;.&lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;2&lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;0.6% &lt;/TD&gt;&lt;TD class="DataEmphasis" nowrap="nowrap" style="font-weight: bold; font-size: x-small; font-style: normal; font-family: Arial; text-align: center;"&gt;100% &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;P&gt;&lt;/P&gt;&lt;P&gt;What I want now is, for the each row of index entry , I want to calculate index, which I define by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index = p_c / (total p_c) *100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example, for the construction index i would calculate the index by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;index_construction = 1.9%/6.0%*100 = 31.666666.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would you go about doing this in proc reort?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&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;I am trying to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="left: -10000px; overflow: hidden; width: 1px; position: absolute; top: 0px; height: 1px;"&gt;﻿&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 06:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54110#M14970</guid>
      <dc:creator>willy0625</dc:creator>
      <dc:date>2012-02-15T06:03:44Z</dc:date>
    </item>
    <item>
      <title>proc report using the calculated last row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54111#M14971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you'd better to post some sample data, then Cynthia or others can test it more.&lt;/P&gt;&lt;P&gt;But I think you can code like something:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;proc report data=sashelp.class nowd;
column name height weight x Index ;
define name/order;
define height/analysis;
define weight/analysis;
define x/computed;
define Index /computed;
compute x;
x=weight.sum/height.sum;
endcomp;
compute before;
sum=x;
endcomp;
compute Index ;
Index=x/sum;
endcomp;
rbreak after/summarize ol;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>Wed, 15 Feb 2012 09:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54111#M14971</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-02-15T09:26:24Z</dc:date>
    </item>
    <item>
      <title>proc report using the calculated last row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54112#M14972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; A few other observations:&lt;/P&gt;&lt;P&gt;1) I agree with Ksharp -- you showed the output from PROC REPORT, but no data -- anyone who tries to help you will either have to make fake data or use SASHELP datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2) You did not specify a destination of choice (RTF, PDF, HTML, LISTING) some of your code options, such as OL are LISTING only options, but you show ODS STYLE= overrides - -which makes me think you have a non-LISTING destination in mind.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;3) you show this division for the calculation of INDEX (using the rounded, displayed, formatted numbers):&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1.9%/6.0%*100 = 31.666666&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the numbers are not internally stored as rounded numbers with a shifted decimal point, and SAS is not dividing by the rounded numbers, as displayed using the percent format. The calculation might be closer to something like this because SAS and PROC REPORT will use the INTERNAL values for the columns:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;0.019230769231 / 0.060344827586 =&amp;nbsp; 0.3186813&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) You show the proposed division as though INDEX_CONSTRUCTION is the variable you are creating. However, you must use the COMPUTED column name in your formula in the COMPUTE block. So if the variable in the COLUMN statement is INDEX, then INDEX is what you would use in your COMPUTE block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;If you want to display this number with a % sign, then you should NOT use the extra multiply by 100 in your calc, because the PERCENT format will do a multiply by 100, too. If you do not want a % in the displayed number, then the multiply by 100 in your formula is correct. If you want to divide using rounded numbers, then you must round them as you do the divide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) What you want to do is entirely do-able with PROC REPORT. You will need to capture the totals for each column (such as p_c) probably in a COMPUTE BEFORE and store the values in temporary variables, so they are automatically retained so you can do the extra division you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 16:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54112#M14972</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-02-15T16:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc report using the calculated last row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54113#M14973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My apologies for forgetting the dataset. I have now attached it with the first post. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the replying Cynthia and Ksharp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 21:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54113#M14973</guid>
      <dc:creator>willy0625</dc:creator>
      <dc:date>2012-02-15T21:34:12Z</dc:date>
    </item>
    <item>
      <title>proc report using the calculated last row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54114#M14974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, that takes care of #1, what about #2? What destination? and #3? The formula for the calculation of INDEX? &lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 22:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54114#M14974</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-02-15T22:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc report using the calculated last row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54115#M14975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; table_generator(var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;PROC REPORT DATA= &amp;amp;var NOWD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;STYLE(header) = [FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) JUST=CENTER FONT_WEIGHT=BOLD]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;STYLE(report) = [FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1.8&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) BORDERWIDTH=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0.2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; CELLSPACING=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0.1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; JUST=CENTER WIDTH=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;980&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;STYLE(column) = [FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) JUST=CENTER]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;STYLE(summary)=[FONT=(Arial,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;2.5&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) FONT_WEIGHT=BOLD];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;COLUMN (&amp;amp;var _FREQ_ Consumer_Default p_c &lt;SPAN style="color: #ff0000;"&gt;index_c&lt;/SPAN&gt; Small_Business_Failure p_s _FREQ_=pct);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;DEFINE &amp;amp;var /ORDER &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"&amp;amp;var"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;DEFINE _FREQ_ /ANALYSIS &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"Frequency"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: teal; font-family: 'Courier New'; background-color: white;"&gt;comma10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;DEFINE p_c /COMPUTED &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"p_c"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: teal; font-family: 'Courier New'; background-color: white;"&gt;percent6.1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;DEFINE index_c /COMPUTED &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;"index_c"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;comma10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;DEFINE p_s /COMPUTED &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"p_s"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: teal; font-family: 'Courier New'; background-color: white;"&gt;percent6.1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;DEFINE pct /ANALYSIS PCTSUM &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"Pop"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; FORMAT=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: teal; font-family: 'Courier New'; background-color: white;"&gt;percent6.1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #ff0000; font-family: 'Courier New'; background-color: white;"&gt;COMPUTE BEFORE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #ff0000; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; T=SUM(T,p_c);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #ff0000; font-family: 'Courier New'; background-color: white;"&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: 'Courier New'; background-color: white;"&gt;COMPUTE p_c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; p_c=Consumer_Default.sum/_FREQ_.sum;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: 'Courier New'; background-color: white;"&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #ff0000; font-family: 'Courier New'; background-color: white;"&gt;COMPUTE index_c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; index_c=p_c/T*&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;100&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #ff0000; font-family: 'Courier New'; background-color: white;"&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;COMPUTE AFTER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; &amp;amp;var = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'Total'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;ENDCOMP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;RBREAK AFTER /SUMMARIZE OL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;table_generator&lt;/EM&gt;&lt;/STRONG&gt;(var=industry);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;I followed your hint and modifed the first block into above and this gave me what I wanted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;The red bits are the bits I have amended/added to calculate the index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;As for the points that Cynthia raised:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;2) I wanted to the output in the excel sheet but I copy and paste from sas into my exisiting spreadsheet so this is ok now. Actually, I would like to look into this later so I can automate the whole process.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;3) I actually do not want any intermediate rounding before get my index. So I am happy with how SAS keeps and uses the original values for index_construcion formula. Sorry for causing confusion in the formula.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;4) I have changed the format of the index into comma9. , so I would get numbers without % symbol.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would save a lot of time for the work I am doing and I see myself re-using this in the future over and over. How great!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 23:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-using-the-calculated-last-row/m-p/54115#M14975</guid>
      <dc:creator>willy0625</dc:creator>
      <dc:date>2012-02-15T23:12:32Z</dc:date>
    </item>
  </channel>
</rss>

