<?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: one way freq table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587536#M167831</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In following code i am trying to change format of one way proc freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example :&lt;/P&gt;
&lt;P&gt;For Make=Hummer frequency=1 and&amp;nbsp;&amp;nbsp;Relative Frequency should be 1/428=0.23%&lt;/P&gt;
&lt;P&gt;But in the output we get 23%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to solve it?&lt;/P&gt;
&lt;P&gt;I guess that something is wrong with&amp;nbsp;pctfmt format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
picture pctfmt low-high='000.00%';
run; 


ods path work.templat(update) sashelp.tmplmst(read); 
proc template; 
edit Base.Freq.OneWayList;
edit Percent;     
header="; Relative Frequency ;"; 
format=pctfmt.;   
justify= on;
end;
edit CumPercent; 
header = ";Cumulative;
Relative Frequency;"; 
format=pctfmt.;
justify= on;
end;   
end;
run;


proc freq data=sashelp.cars;
tables Make  / list;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Digit selectors in Picture formats don't always work the way you think they will until you have worked with them a lot.&lt;/P&gt;
&lt;P&gt;Typically the formats suggest by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;are likely what you want.&lt;/P&gt;
&lt;P&gt;I also think this is the format you may have intended to basically duplicate that 8.2 (or similar range) would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work; 
picture pctfmt low-high='009.99%';
run; &lt;/PRE&gt;
&lt;P&gt;The non-zero values in the string will force a character before the decimal, 0 if no actual value of 1 or greater in the data, and the non-zero after the decimal will always display 2 characters as appropriate (data will be truncated not rounded). Without any non-zero characters in the display string values that are less than 1 , such as your .23 don't really have a good alignment with the picture.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 14:34:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-09-10T14:34:53Z</dc:date>
    <item>
      <title>one way freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587425#M167782</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In following code i am trying to change format of one way proc freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example :&lt;/P&gt;
&lt;P&gt;For Make=Hummer frequency=1 and&amp;nbsp;&amp;nbsp;Relative Frequency should be 1/428=0.23%&lt;/P&gt;
&lt;P&gt;But in the output we get 23%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to solve it?&lt;/P&gt;
&lt;P&gt;I guess that something is wrong with&amp;nbsp;pctfmt format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
picture pctfmt low-high='000.00%';
run; 


ods path work.templat(update) sashelp.tmplmst(read); 
proc template; 
edit Base.Freq.OneWayList;
edit Percent;     
header="; Relative Frequency ;"; 
format=pctfmt.;   
justify= on;
end;
edit CumPercent; 
header = ";Cumulative;
Relative Frequency;"; 
format=pctfmt.;
justify= on;
end;   
end;
run;


proc freq data=sashelp.cars;
tables Make  / list;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 05:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587425#M167782</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-09-10T05:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: one way freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587475#M167804</link>
      <description>&lt;P&gt;If it is helpful, &lt;A href="https://blogs.sas.com/content/iml/2015/08/10/percent-formats.html" target="_self"&gt;SAS supports the PERCENTw.d format.&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Try PERCENT8.2.&amp;nbsp; If you have negative percentages, you can also use the PERCENTN8.2 format.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 11:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587475#M167804</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-09-10T11:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: one way freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587536#M167831</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In following code i am trying to change format of one way proc freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example :&lt;/P&gt;
&lt;P&gt;For Make=Hummer frequency=1 and&amp;nbsp;&amp;nbsp;Relative Frequency should be 1/428=0.23%&lt;/P&gt;
&lt;P&gt;But in the output we get 23%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to solve it?&lt;/P&gt;
&lt;P&gt;I guess that something is wrong with&amp;nbsp;pctfmt format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
picture pctfmt low-high='000.00%';
run; 


ods path work.templat(update) sashelp.tmplmst(read); 
proc template; 
edit Base.Freq.OneWayList;
edit Percent;     
header="; Relative Frequency ;"; 
format=pctfmt.;   
justify= on;
end;
edit CumPercent; 
header = ";Cumulative;
Relative Frequency;"; 
format=pctfmt.;
justify= on;
end;   
end;
run;


proc freq data=sashelp.cars;
tables Make  / list;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Digit selectors in Picture formats don't always work the way you think they will until you have worked with them a lot.&lt;/P&gt;
&lt;P&gt;Typically the formats suggest by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;are likely what you want.&lt;/P&gt;
&lt;P&gt;I also think this is the format you may have intended to basically duplicate that 8.2 (or similar range) would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work; 
picture pctfmt low-high='009.99%';
run; &lt;/PRE&gt;
&lt;P&gt;The non-zero values in the string will force a character before the decimal, 0 if no actual value of 1 or greater in the data, and the non-zero after the decimal will always display 2 characters as appropriate (data will be truncated not rounded). Without any non-zero characters in the display string values that are less than 1 , such as your .23 don't really have a good alignment with the picture.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 14:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-way-freq-table/m-p/587536#M167831</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-10T14:34:53Z</dc:date>
    </item>
  </channel>
</rss>

