<?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: How to add a percent sign to data (when you've already applied a format to round) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974871#M46171</link>
    <description>&lt;P&gt;As others have said why not just add a step to divide by 100?&lt;/P&gt;
&lt;P&gt;If you did want to do it in the PROC REPORT step then make a new computed variable and divide it there.&amp;nbsp; I had to force the sum to 1 to get the summary line to print, not sure why.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class;
  tables age / noprint missing out=counts nocol nocum ;  
run;

proc report data=counts nowd
  style(header)=[color = cxCC0000]
;
  columns age Count percent percent=p2 age=Avg;
  define age / left display "Age" ;
  define percent / display noprint;
  define p2 / computed center analysis sum "%" format=percent8.1 width=10;
  define Count/center analysis sum "N" width=10 ;
  define Avg/ center analysis mean weight=Count noprint;
  rbreak after / summarize
    style(summary)=[color = cxCC0000 font_weight=bold just=center]
  ;
  compute p2 ;
    p2 = percent/100 ;
  endcomp;
  compute after / style =[just=left color =cxCC0000 fontstyle=italic];
    p2=1;
    line 'Mean Age' +145 Avg 8.2;
  endcomp;
  Compute before _page_ / style =[just=center fontsize=10pt fontweight=bold] ;
    line "TITLE OF MY TABLE";
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1757615659863.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109915iB93EA14D4266C09B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1757615659863.png" alt="Tom_0-1757615659863.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2025 18:34:28 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-09-11T18:34:28Z</dc:date>
    <item>
      <title>How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974861#M46165</link>
      <description>&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with survey data. For my Q2 I start with a frequency table that counts and creates a percentage. (Note that it's the real percentage already multiplied by 100.)&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="snrich_0-1757611310655.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109913iF20DB665BA540616/image-size/medium?v=v2&amp;amp;px=400" role="button" title="snrich_0-1757611310655.png" alt="snrich_0-1757611310655.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In my proc report, I want the percentage rounded so I included format=8.1. &lt;STRONG&gt;However, I want my final report to have actual percentage signs.&lt;/STRONG&gt; I think I essentially want a double format. What can I do to have my cake and eat it too? I don't think I can use the percent format here. I've tried one of those picture formats (low-high) but it doesn't work because I also want it to round.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=Lib.Q2Response noprint;
	tables Q2 / missing out=Lib.Q2_freq nocol nocum all;	
run;

proc report data=Lib.Q2_freq nowd
	style(header)=[color = cxCC0000];
	columns Q2 Count percent Q2=Avg;
	define Q2 / left display "Response" width=45;
	define percent / center analysis sum "%" format=8.1 width=10;
	define Count/center analysis sum "N" width=10 ;
    define Avg/ center analysis mean weight=Count noprint;
		rbreak after / summarize
		style(summary)=[color = cxCC0000 font_weight=bold just=center];
	compute after / style =[just=left color =cxCC0000 fontstyle=italic];
	 	line 'Mean Rating' +145 Avg 8.2;
	endcomp;
	Compute before _page_ / style =[just=center fontsize=10pt fontweight=bold] ;
		line "TITLE OF MY TABLE";
	endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(I want my table to say 3.8%, etc.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snrich_1-1757611618657.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109914i32CC23726FBAF6A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="snrich_1-1757611618657.png" alt="snrich_1-1757611618657.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 17:34:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974861#M46165</guid>
      <dc:creator>SamSays</dc:creator>
      <dc:date>2025-09-11T17:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974864#M46167</link>
      <description>&lt;P&gt;In general, it's best to *not* multiply the value by 100 and instead just use the built-in SAS 'percent' format.&amp;nbsp; To round to one decimal place, just use:&amp;nbsp;&amp;nbsp;&lt;BR /&gt;format your_variable percent8.1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974864#M46167</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-09-11T18:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974865#M46168</link>
      <description>&lt;P&gt;But my proc feq is creating my percentage. It's doing that for me and I don't know how to get it to not do that. Do you know?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974865#M46168</guid>
      <dc:creator>SamSays</dc:creator>
      <dc:date>2025-09-11T18:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974868#M46169</link>
      <description>&lt;P&gt;I'll have to defer to others - I have done my best to avoid PROC REPORT and so really can't advise here. But you could try changing the PROC FREQ output dataset 'lib.Q2_Freq' as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lib.q2_freq;
set lib.q2_freq;
percent=percent/100;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;...and then, in the PROC REPORT, on the line where you currently have &lt;BR /&gt;format=8.1&amp;nbsp; &amp;nbsp;&lt;BR /&gt;...change to:&lt;BR /&gt;format=percent8.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974868#M46169</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-09-11T18:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974871#M46171</link>
      <description>&lt;P&gt;As others have said why not just add a step to divide by 100?&lt;/P&gt;
&lt;P&gt;If you did want to do it in the PROC REPORT step then make a new computed variable and divide it there.&amp;nbsp; I had to force the sum to 1 to get the summary line to print, not sure why.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class;
  tables age / noprint missing out=counts nocol nocum ;  
run;

proc report data=counts nowd
  style(header)=[color = cxCC0000]
;
  columns age Count percent percent=p2 age=Avg;
  define age / left display "Age" ;
  define percent / display noprint;
  define p2 / computed center analysis sum "%" format=percent8.1 width=10;
  define Count/center analysis sum "N" width=10 ;
  define Avg/ center analysis mean weight=Count noprint;
  rbreak after / summarize
    style(summary)=[color = cxCC0000 font_weight=bold just=center]
  ;
  compute p2 ;
    p2 = percent/100 ;
  endcomp;
  compute after / style =[just=left color =cxCC0000 fontstyle=italic];
    p2=1;
    line 'Mean Age' +145 Avg 8.2;
  endcomp;
  Compute before _page_ / style =[just=center fontsize=10pt fontweight=bold] ;
    line "TITLE OF MY TABLE";
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1757615659863.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109915iB93EA14D4266C09B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1757615659863.png" alt="Tom_0-1757615659863.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:34:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974871#M46171</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-09-11T18:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974873#M46172</link>
      <description>&lt;P&gt;Thanks, Tom!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974873#M46172</guid>
      <dc:creator>SamSays</dc:creator>
      <dc:date>2025-09-11T18:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974885#M46174</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282541"&gt;@SamSays&lt;/a&gt;,&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/282541"&gt;@SamSays&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I've tried one of those picture formats (low-high) but it doesn't work because I also want it to round.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Picture formats do round if you use the &lt;A href="https://documentation.sas.com/doc/hi/pgmsascdc/9.4_3.5/proc/p0n990vq8gxca6n1vnsracr6jp2c.htm#p1fh7u9t4ya6fgn15mc3niroo9a0" target="_blank" rel="noopener"&gt;ROUND option&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;proc format;
picture pctfmt &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;(round)&lt;/STRONG&gt;&lt;/FONT&gt; 0-high='0009.9%';
run;&lt;/PRE&gt;
&lt;P&gt;As demonstrated below, this picture format displays non-negative values x&amp;lt;999.95 exactly like the PERCENT8.1 format displays x/100.&lt;/P&gt;
&lt;PRE&gt;247   data chk;
248   do n=0 to 999949;
249     x=n/1000;
250     p1=put(x, pctfmt.);
251     p2=put(x/100, percent8.1);
252     if p1 ne p2 then output;
253   end;
254   run;

NOTE: The data set WORK.CHK has 0 observations and 4 variables.&lt;/PRE&gt;
&lt;P&gt;However, the PERCENT8.1 format adds an unnecessary trailing blank, so that variable &lt;FONT face="courier new,courier"&gt;p2&lt;/FONT&gt; has length 8, whereas &lt;FONT face="courier new,courier"&gt;p1&lt;/FONT&gt; has length 7, which is the default length of the format. Unlike PERCENT8.1, the picture format would also display larger values up to 9999.949... correctly.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 21:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974885#M46174</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-09-11T21:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a percent sign to data (when you've already applied a format to round)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974892#M46175</link>
      <description>&lt;P&gt;Don't forget the Picture formats also supports the MULTIPLIER option to do the multiplication (or division by 100 if using a value of 0.01 for multiplier) though it always takes me some trial and error to get the right multiplier for the use I need as I don't use it often enough.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 23:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-add-a-percent-sign-to-data-when-you-ve-already-applied-a/m-p/974892#M46175</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-09-11T23:43:00Z</dc:date>
    </item>
  </channel>
</rss>

