<?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: preloadfmt and proc summary in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557240#M9961</link>
    <description>&lt;P&gt;You need the missing option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When counting with PROC SUMMARY you can use _FREQ_ no need for dummy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value $YN
      'Y'='Yes'
      'N'='No'
      Other='Missing';
   run;
data adsl;
   do id = 1 to 20;
      smoking = ' ';
      output;
      end;
   run;
proc summary data=adsl nway completetypes missing;
   *by popfl;
   class smoking / preloadfmt;
   output out = want;
   format smoking $YN.;
   run;
proc print;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 May 2019 18:51:45 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2019-05-08T18:51:45Z</dc:date>
    <item>
      <title>preloadfmt and proc summary</title>
      <link>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557235#M9957</link>
      <description>&lt;P&gt;proc format;&lt;BR /&gt;value $YN&lt;BR /&gt;'Y'='Yes'&lt;BR /&gt;'N'='No'&lt;BR /&gt;Other='Missing';&lt;BR /&gt;run;&lt;BR /&gt;dataset has 20 records and one of the variable is smoking.All records for smoing are Blanks.&lt;/P&gt;&lt;P&gt;I applied the format to smoking variable in Proc summary using preloadfmt.&lt;/P&gt;&lt;P&gt;I want to display Missing as 20 . When I run proc summary I see the below counts:&lt;/P&gt;&lt;P&gt;proc summary data = ads1 n completetypes;&lt;BR /&gt;by popfl ;&lt;BR /&gt;class smoking / preloadfmt ;&lt;BR /&gt;var dummy;&lt;BR /&gt;output out = want n=count;&lt;BR /&gt;format smoking $YN.;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;Missing 0&lt;BR /&gt;Yes 0&lt;BR /&gt;No 0&lt;/P&gt;&lt;P&gt;Where am I going wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 18:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557235#M9957</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-05-08T18:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: preloadfmt and proc summary</title>
      <link>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557240#M9961</link>
      <description>&lt;P&gt;You need the missing option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When counting with PROC SUMMARY you can use _FREQ_ no need for dummy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value $YN
      'Y'='Yes'
      'N'='No'
      Other='Missing';
   run;
data adsl;
   do id = 1 to 20;
      smoking = ' ';
      output;
      end;
   run;
proc summary data=adsl nway completetypes missing;
   *by popfl;
   class smoking / preloadfmt;
   output out = want;
   format smoking $YN.;
   run;
proc print;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 May 2019 18:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557240#M9961</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-05-08T18:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: preloadfmt and proc summary</title>
      <link>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557255#M9969</link>
      <description>&lt;P&gt;You might want to only show the missing row when there are missing values.&amp;nbsp; Here is one way to accomplish that by recoding blank SMOKING to "Missing"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data adsl;
   length smoking $8;
   do id = 1 to 20;
      smoking = chooseC(rantbl(4,.5,.5,.1),'Y','N','Missing');
      output;
      end;
   run;
proc print;
   run;
proc format;
   value $YN(notsorted default=8) 
      'Y'='Yes'
      'N'='No'
      ;
   quit;
proc summary data=adsl nway completetypes missing;
   class smoking / preloadfmt order=data;
   output out=want / levels;
   format smoking $YN.;
   run;
proc print;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 19:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/preloadfmt-and-proc-summary/m-p/557255#M9969</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-05-08T19:13:39Z</dc:date>
    </item>
  </channel>
</rss>

