<?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 get counts and % for all values in proc format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775881#M81130</link>
    <description>&lt;P&gt;Different procs different possibilities:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.cars;
   class type/ preloadfmt;
   format type $car_type.;
   tables type,
          n colpctn
          /printmiss misstext='0'
   ;
run;&lt;/PRE&gt;
&lt;PRE&gt;proc report data=sashelp.cars completerows;
   columns type ( n pctn);
   define type / group format=$car_type. preloadfmt ;
   define pctn /format=percent8.2;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Oct 2021 14:33:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-10-22T14:33:01Z</dc:date>
    <item>
      <title>how to get counts and % for all values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775858#M81127</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a format with all values.&amp;nbsp; How do I get counts and % for these values from a dataset&amp;nbsp; ? If the values are not present in dataset, i need count and percent as 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;proc format library = work;
 value $car_type
  "Hybrid" = "Hybrid Drivetrain"
  "SUV" = "Sports Utility Vehicle"
  "Sedan" = "4-door Sedan"
  "Truck" = "Pickup Truck"
  "Wagon" = "Station Wagon"
  "Testc" = "Test value"
 ;
run;
&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;But when I run proc feq, I need frequency and percent for type as Testc. Even though it is 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc freq data = sashelp.cars;
tables type / missing;
format type $car_type.;
run;&lt;/PRE&gt;&lt;P&gt;I came across 1 article where it says its not possible, but it dated 2015. So wondering if there is any new feature added to SAS. I'm using&amp;nbsp;&lt;STRONG&gt;SAS release:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;9.04.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/How-To-Create-Count-of-Variable-with-Missing-Value/td-p/237342" target="_blank"&gt;Solved: How To - Create Count of Variable with Missing Val... - SAS Support Communities&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 12:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775858#M81127</guid>
      <dc:creator>adrnneadriana</dc:creator>
      <dc:date>2021-10-22T12:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to get counts and % for all values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775874#M81129</link>
      <description>&lt;P&gt;I don't think PROC FREQ can do this without some manipulation of the data set. However, PROC SUMMARY/PROC MEANS can do this, example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.cars completetypes;
    class type/preloadfmt;
    format type $car_type.;
    var invoice;
    output out=_stats_ n=n;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Oct 2021 13:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775874#M81129</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-22T13:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to get counts and % for all values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775881#M81130</link>
      <description>&lt;P&gt;Different procs different possibilities:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.cars;
   class type/ preloadfmt;
   format type $car_type.;
   tables type,
          n colpctn
          /printmiss misstext='0'
   ;
run;&lt;/PRE&gt;
&lt;PRE&gt;proc report data=sashelp.cars completerows;
   columns type ( n pctn);
   define type / group format=$car_type. preloadfmt ;
   define pctn /format=percent8.2;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Oct 2021 14:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/775881#M81130</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-22T14:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to get counts and % for all values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/779864#M81208</link>
      <description>Thank you, how about if my input dataset is empty ?&lt;BR /&gt;&lt;BR /&gt;In that case, I'm not getting the pre loaded formats</description>
      <pubDate>Thu, 11 Nov 2021 22:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/779864#M81208</guid>
      <dc:creator>adrnneadriana</dc:creator>
      <dc:date>2021-11-11T22:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to get counts and % for all values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/779968#M81209</link>
      <description>&lt;P&gt;Creating a dataset with a empty obs when its empty as per below one&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/I-want-empty-dataset-to-be-worked-in-Proc-means/td-p/72363" target="_blank"&gt;I want empty dataset to be worked in Proc means. - SAS Support Communities&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 13:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-get-counts-and-for-all-values-in-proc-format/m-p/779968#M81209</guid>
      <dc:creator>adrnneadriana</dc:creator>
      <dc:date>2021-11-12T13:44:08Z</dc:date>
    </item>
  </channel>
</rss>

