<?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: Varying format by row in Proc Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968685#M376610</link>
    <description>&lt;P&gt;I do not see any counting in this code at all.&amp;nbsp; Perhaps the the fact that the row percentages add up to 200% was created in the step that made the source dataset?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jun 2025 20:07:53 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-06-10T20:07:53Z</dc:date>
    <item>
      <title>Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968679#M376608</link>
      <description>&lt;P&gt;Based on this example&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-different-formats-for-different-rows/td-p/403157" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-different-formats-for-different-rows/td-p/403157&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I wrote the following code.&amp;nbsp; &amp;nbsp;See the last 3 compute blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc format;
   picture custpct low-high='0009.9%' (mult=10);  /*  Adjust format as needed  */
run;
proc report data=Tbl1;
	col GrpVar Lab Total MA_PDs PDPs;
	define GrpVar / Group noprint;
	define Lab / '' Group order=data;
	define Total / format=comma12.;
	define MA_PDs / format=comma12.;
	define PDPs / format=comma12.;
	compute before GrpVar / style = {just=left font_weight=bold};;
		length brkline $100;
		if grpVar=1 then brkline='Plans';
		else if grpVar=2 then brkline='Plans by tier count';
		else if GrpVar=3 then brkline='Formularies';
		else if GrpVar=4 then brkline='Beneficiaries';
		line brkline $100.; 
	endcomp;
	compute Total;
		if Lab='Percent' then call define('_c3_','format','custpct.');
	endcomp;
	compute MA_PDs;
		if Lab='Percent' then call define('_c4_','format','custpct.');
	endcomp;
	compute PDPs;
		if Lab='Percent' then call define('_c5_','format','custpct.');
	endcomp;
run;&lt;/PRE&gt;&lt;P&gt;It ran.&amp;nbsp; However, for some reason, the percentages are truncated.&amp;nbsp; &amp;nbsp;The second "Percent" row as some double counting, but can I get the first and third to sum to 100.0%?&lt;/P&gt;&lt;TABLE cellspacing="10 px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10 px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10 px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10 px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Table&amp;nbsp;1:&amp;nbsp;Number&amp;nbsp;of&amp;nbsp;Plans&amp;nbsp;and&amp;nbsp;Formularies&amp;nbsp;for&amp;nbsp;PDPs&amp;nbsp;and&amp;nbsp;MA-PDs&amp;nbsp;in&amp;nbsp;2025&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10 px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;&amp;nbsp; Total MA-PDs PDPs &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Plans&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Number&lt;/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pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968679#M376608</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T19:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968685#M376610</link>
      <description>&lt;P&gt;I do not see any counting in this code at all.&amp;nbsp; Perhaps the the fact that the row percentages add up to 200% was created in the step that made the source dataset?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 20:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968685#M376610</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-10T20:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968694#M376613</link>
      <description>&lt;P&gt;Sorry, the image of the output is out of whack.&amp;nbsp; &amp;nbsp; Hopefully this is a better image.&amp;nbsp; &amp;nbsp;The Report Procedure doesn't sum anything, I'm just using to display the exact contents of a dataset because it has so many more options than Proc Print.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, the percentages in row Excel rows 11 and 26 should sum to 100.0%, but they don't with the code I used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Batman_0-1749589693167.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107738i349DBD7CBC8BCACA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Batman_0-1749589693167.png" alt="Batman_0-1749589693167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 21:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968694#M376613</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T21:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968695#M376614</link>
      <description>&lt;P&gt;It is virtually impossible to fix your code without having (a representative portion of) the data in data st TBL1. Please provide the data as working SAS data step code (&lt;A href="http://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;) and &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;not&lt;/STRONG&gt; &lt;/FONT&gt;in any other form. Excel files are not acceptable. Copy and paste from Excel are not acceptable. Screen captures of data are not acceptable.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 21:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968695#M376614</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-10T21:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968696#M376615</link>
      <description>How do I generate what you are asking for? Print it in the log?&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Jun 2025 21:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968696#M376615</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T21:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968700#M376616</link>
      <description>&lt;P&gt;Easier to PUT it to the log. Then copy the generated text and use it to make a data step to read it back in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a macro that will generate such code from a source dataset.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/ds2post.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/ds2post.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example if you run this macro call&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%ds2post(sashelp.class)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It will write these lines to the SAS log.&lt;/P&gt;
&lt;PRE&gt;data work.class (label='Student Data');
  infile datalines dsd dlm='|' truncover;
  input Name :$8. Sex :$1. Age Height Weight ;
datalines4;
Alfred|M|14|69|112.5
Alice|F|13|56.5|84
Barbara|F|13|65.3|98
Carol|F|14|62.8|102.5
Henry|M|14|63.5|102.5
James|M|12|57.3|83
Jane|F|12|59.8|84.5
Janet|F|15|62.5|112.5
Jeffrey|M|13|62.5|84
John|M|12|59|99.5
Joyce|F|11|51.3|50.5
Judy|F|14|64.3|90
Louise|F|12|56.3|77
Mary|F|15|66.5|112
Philip|M|16|72|150
Robert|M|12|64.8|128
Ronald|M|15|67|133
Thomas|M|11|57.5|85
William|M|15|66.5|112
;;;;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 21:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968700#M376616</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-10T21:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968701#M376617</link>
      <description>&lt;P&gt;And how different are the numbers when you just use PROC PRINT?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 22:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968701#M376617</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-10T22:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968704#M376618</link>
      <description>&lt;PRE&gt;data work.tbl1 ;
  infile datalines dsd dlm='|' truncover;
  input GrpVar Lab :$100. Total MA_PDs PDPs ;
  format Total comma12.1 MA_PDs comma12.1 PDPs comma12.1 ;
  label MA_PDs='MA-PDs' ;
datalines4;
1|Number|5244|4770|474
1|Percent|100|90.9610983981693|9.03890160183066
2|None|2|2|0
2|one|260|260|0
2|two|28|28|0
2|three|1|1|0
2|four|39|39|0
2|five|3941|3467|474
2|six|957|957|0
2|seven|16|16|0
3|Number|384|346|40
3|Percent|100|90.1041666666666|10.4166666666666
4|Number|46481848|28266979|18214869
4|Percent|100|60.8129414303837|39.1870585696162
;;;;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jun 2025 22:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968704#M376618</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T22:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968706#M376619</link>
      <description>The percentage values look good in Proc Print, I just can't format the table the way I would like in Print.</description>
      <pubDate>Tue, 10 Jun 2025 22:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968706#M376619</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T22:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968708#M376620</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9248"&gt;@Batman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;data work.tbl1 ;
  infile datalines dsd dlm='|' truncover;
  input GrpVar Lab :$100. Total MA_PDs PDPs ;
  format Total comma12.1 MA_PDs comma12.1 PDPs comma12.1 ;
  label MA_PDs='MA-PDs' ;
datalines4;
1|Number|5244|4770|474
1|Percent|100|90.9610983981693|9.03890160183066
2|None|2|2|0
2|one|260|260|0
2|two|28|28|0
2|three|1|1|0
2|four|39|39|0
2|five|3941|3467|474
2|six|957|957|0
2|seven|16|16|0
3|Number|384|346|40
3|Percent|100|90.1041666666666|10.4166666666666
4|Number|46481848|28266979|18214869
4|Percent|100|60.8129414303837|39.1870585696162
;;;;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;We're not asking for the output as SAS data step code. We're asking for the data in data set TBL1, which you haven't yet shown us. I have given you a link to the instructions on how to do this.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 22:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968708#M376620</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-10T22:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968710#M376621</link>
      <description>&lt;P&gt;Those values add up to 200% when you use PROC PRINT.&amp;nbsp; Your PROC REPORT code does not change the values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1749596456790.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107739i071DFDFA79F07C65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1749596456790.png" alt="Tom_0-1749596456790.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1749596483671.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107740i8497E4F41EC26AD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_1-1749596483671.png" alt="Tom_1-1749596483671.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 23:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968710#M376621</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-10T23:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968713#M376622</link>
      <description>&lt;P&gt;The "Total" column is the sum of columns "MA_PDs" and "PDPs"&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 23:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968713#M376622</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T23:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968714#M376623</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9248"&gt;@Batman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The "Total" column is the sum of columns "MA_PDs" and "PDPs"&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you start over and explain what your issue actually is?&lt;/P&gt;
&lt;P&gt;Now that you have shared the data perhaps you can explain using example values to show more clearly what you want that is different from what you are getting.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 23:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968714#M376623</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-10T23:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968715#M376624</link>
      <description>&lt;P&gt;Yes,&amp;nbsp; I'm trying to get the percentage rows to round rather than truncate.&lt;/P&gt;&lt;P&gt;This row, for example&lt;/P&gt;&lt;PRE&gt;1|Percent|100|90.9610983981693|9.03890160183066&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Gives me "100.0, 90.9, and 9.0" for example in the Report Procedure as I currently have it written (see my first post).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want it to be "100.0, 91.0 and 9.0"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect the format procedure is the problem, but was hoping for some guidance on how to make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 23:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968715#M376624</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2025-06-10T23:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Varying format by row in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968716#M376625</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9248"&gt;@Batman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes,&amp;nbsp; I'm trying to get the percentage rows to round rather than truncate.&lt;/P&gt;
&lt;P&gt;This row, for example&lt;/P&gt;
&lt;PRE&gt;1|Percent|100|90.9610983981693|9.03890160183066&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Gives me "100.0, 90.9, and 9.0" for example in the Report Procedure as I currently have it written (see my first post).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want it to be "100.0, 91.0 and 9.0"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect the format procedure is the problem, but was hoping for some guidance on how to make it work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well that is simple and we didn't need to see the complex PROC REPORT code to fix that. Use the ROUND option in the PICTURE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   picture custpct (round) low-high='0009.9%' (mult=10);  /*  Adjust format as needed  */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;554  data _null_;
555    set  tbl1 ;
556    where Lab = 'Percent';
557    put GrpVar= Lab=
558      / (Total MA_PDs PDPs) (=best12.)
559      / (Total MA_PDs PDPs) (=custpct.)
560      /
561    ;
562  run;

GrpVar=1 Lab=Percent
Total=100 MA_PDs=90.961098398 PDPs=9.0389016018
Total=100.0% MA_PDs=91.0% PDPs=9.0%

GrpVar=3 Lab=Percent
Total=100 MA_PDs=90.104166667 PDPs=10.416666667
Total=100.0% MA_PDs=90.1% PDPs=10.4%

GrpVar=4 Lab=Percent
Total=100 MA_PDs=60.81294143 PDPs=39.18705857
Total=100.0% MA_PDs=60.8% PDPs=39.2%
&lt;/PRE&gt;
&lt;P&gt;But rounding is not the issue for GRPVAR=3.&amp;nbsp; To figure out why the two values add up to 100.5% you will need to look into how the input dataset was generated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 23:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-format-by-row-in-Proc-Report/m-p/968716#M376625</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-10T23:28:22Z</dc:date>
    </item>
  </channel>
</rss>

