<?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: Adding to total row to a numeric group value in Proc Report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Adding-to-total-row-to-a-numeric-group-value-in-Proc-Report/m-p/727558#M80314</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; For using a numeric variable as the column where you want to display something on the break (typically, the numeric variable is either GROUP or ORDER). I used this example, because I already had it and I didn't want to edit the code out of your posted LOG.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1616099115307.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56131i8523AA5ACDB50150/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1616099115307.png" alt="Cynthia_sas_0-1616099115307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Using NOPRINT for the numeric column and then computing a character column of the right length just for display purposes is the technique I use (here I have a very long string, just to illustrate the point).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 18 Mar 2021 20:26:48 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2021-03-18T20:26:48Z</dc:date>
    <item>
      <title>Adding to total row to a numeric group value in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-to-total-row-to-a-numeric-group-value-in-Proc-Report/m-p/727492#M80313</link>
      <description>&lt;P&gt;I'm trying to add total row header and received an error messages because the Group variable is numeric.&amp;nbsp; &amp;nbsp;Can anyone recommend a solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;26 data tab1;&lt;BR /&gt;27 input c $ year benes death;&lt;BR /&gt;28 list;&lt;BR /&gt;29 datalines;&lt;/P&gt;&lt;P&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;BR /&gt;30 a 2009 1 1&lt;BR /&gt;31 a 2010 1 0&lt;BR /&gt;32 a 2009 1 0&lt;BR /&gt;33 a 2010 1 1&lt;BR /&gt;34 a 2010 1 0&lt;BR /&gt;35 a 2010 1 0&lt;BR /&gt;36 b 2009 1 1&lt;BR /&gt;37 b 2010 1 0&lt;BR /&gt;38 b 2009 1 0&lt;BR /&gt;39 b 2010 1 0&lt;BR /&gt;NOTE: The data set WORK.TAB1 has 10 observations and 4 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;40 ;&lt;/P&gt;&lt;P&gt;41 run;&lt;BR /&gt;42&lt;BR /&gt;43 proc format;&lt;BR /&gt;44 value dec&lt;BR /&gt;45 0='No'&lt;BR /&gt;46 1='Yes'&lt;BR /&gt;47 ;&lt;BR /&gt;NOTE: Format DEC is already on the library WORK.FORMATS.&lt;BR /&gt;NOTE: Format DEC has been output.&lt;BR /&gt;2 The SAS System 11:28 Thursday, March 18, 2021&lt;/P&gt;&lt;P&gt;48 value missnum&lt;BR /&gt;49 . = '0'&lt;BR /&gt;50 other=[comma8.]&lt;BR /&gt;51 ;&lt;BR /&gt;NOTE: Format MISSNUM is already on the library WORK.FORMATS.&lt;BR /&gt;NOTE: Format MISSNUM has been output.&lt;BR /&gt;52 value missdec&lt;BR /&gt;53 . = '0'&lt;BR /&gt;54 other=[8.2]&lt;BR /&gt;55 ;&lt;BR /&gt;NOTE: Format MISSDEC is already on the library WORK.FORMATS.&lt;BR /&gt;NOTE: Format MISSDEC has been output.&lt;BR /&gt;56 value misspct&lt;BR /&gt;57 . = '0.0%'&lt;BR /&gt;58 other=[percent7.1]&lt;BR /&gt;59 ;&lt;BR /&gt;NOTE: Format MISSPCT is already on the library WORK.FORMATS.&lt;BR /&gt;NOTE: Format MISSPCT has been output.&lt;BR /&gt;60 run;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE FORMAT used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;61&lt;BR /&gt;62 proc report data=tab1 split='~';&lt;BR /&gt;63 columns c year benes=benessum ('deceased' death, benes) death=decpct&lt;BR /&gt;64 ('rate' death, benes=rate1) benes=rate2 ('increase likelihood~of disenrollment' likelihood);&lt;BR /&gt;65 define c /group ;&lt;BR /&gt;66 define year / group;&lt;BR /&gt;67 define benessum / sum 'Benes' format=missnum.;&lt;BR /&gt;68 define death / across '' format=dec. missing;&lt;BR /&gt;69 define benes / analysis '' sum format=missnum.;&lt;BR /&gt;70 define decpct / analysis 'pct deceased' mean format=misspct.;&lt;BR /&gt;71 define rate1 / analysis '' pctsum format=misspct.;&lt;BR /&gt;72 define rate2 / analysis 'pct of cohort' pctsum format=misspct.;&lt;BR /&gt;73 define likelihood / computed ''&lt;BR /&gt;74 format=missdec.;&lt;BR /&gt;75 break after c / summarize;&lt;BR /&gt;76 rbreak after / summarize;&lt;BR /&gt;77 compute after c;&lt;BR /&gt;78 year = 'Total';&lt;BR /&gt;79 endcomp;&lt;BR /&gt;80 compute after;&lt;BR /&gt;81 c='Total';&lt;BR /&gt;82 endcomp;&lt;BR /&gt;83 compute likelihood;&lt;BR /&gt;84 likelihood=_c8_/_c7_;&lt;BR /&gt;85 endcomp;&lt;BR /&gt;86&lt;BR /&gt;87 run;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;1:9&lt;BR /&gt;NOTE: Invalid numeric data, 'Total' , at line 1 column 9.&lt;BR /&gt;NOTE: Invalid numeric data, 'Total' , at line 1 column 9.&lt;BR /&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;3 The SAS System 11:28 Thursday, March 18, 2021&lt;/P&gt;&lt;P&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;1 at 1:17&lt;BR /&gt;NOTE: There were 10 observations read from the data set WORK.TAB1.&lt;BR /&gt;NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST" format.&lt;BR /&gt;NOTE: PROCEDURE REPORT used (Total process time):&lt;BR /&gt;real time 0.32 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 17:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-to-total-row-to-a-numeric-group-value-in-Proc-Report/m-p/727492#M80313</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2021-03-18T17:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding to total row to a numeric group value in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-to-total-row-to-a-numeric-group-value-in-Proc-Report/m-p/727558#M80314</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; For using a numeric variable as the column where you want to display something on the break (typically, the numeric variable is either GROUP or ORDER). I used this example, because I already had it and I didn't want to edit the code out of your posted LOG.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1616099115307.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56131i8523AA5ACDB50150/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1616099115307.png" alt="Cynthia_sas_0-1616099115307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Using NOPRINT for the numeric column and then computing a character column of the right length just for display purposes is the technique I use (here I have a very long string, just to illustrate the point).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 20:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-to-total-row-to-a-numeric-group-value-in-Proc-Report/m-p/727558#M80314</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-03-18T20:26:48Z</dc:date>
    </item>
  </channel>
</rss>

