<?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: freq of missing and non missing values for each field in data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543773#M150335</link>
    <description>&lt;P&gt;This is the case for both Sex and Name (the character variables) because you have to specify your format with a blank " " in the Format Procedure and not a "". So this gives your the desired result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value $missfmt
' '="missing"
other="Non Missing";

value missfmt
.="missing"
other="Non Missing";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&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-left" image-alt="Capture.PNG" style="width: 338px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27999iB8836E532D222E10/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Mar 2019 07:31:04 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-03-17T07:31:04Z</dc:date>
    <item>
      <title>freq of missing and non missing values for each field in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543770#M150332</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Why in the following code the output of frequency in "name" field is not correct.&lt;/P&gt;
&lt;P&gt;It shows that there are no missing values for field "name " but actually there are 4 missing value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value $missfmt
''="missing"
other="Non Missing";
value missfmt
.="missing"
other="Non Missing";
run;
data have;
set sashelp.class;
if _N_ in (2,5,8,13) then do;
  call missing(of _numeric_);
end;
if _N_ in (5,6,8,12) then do;
  call missing(of _character_);
end;
run;
proc freq  data=have;
format _character_ $missfmt.;
tables _character_/missing missprint nocum nopercent;
format _numeric_ missfmt.;
tables _numeric_/missing missprint nocum nopercent;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Mar 2019 07:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543770#M150332</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-03-17T07:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: freq of missing and non missing values for each field in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543773#M150335</link>
      <description>&lt;P&gt;This is the case for both Sex and Name (the character variables) because you have to specify your format with a blank " " in the Format Procedure and not a "". So this gives your the desired result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value $missfmt
' '="missing"
other="Non Missing";

value missfmt
.="missing"
other="Non Missing";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&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-left" image-alt="Capture.PNG" style="width: 338px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27999iB8836E532D222E10/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 07:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543773#M150335</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-17T07:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: freq of missing and non missing values for each field in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543776#M150337</link>
      <description>As part of the format definitions, do you have:&lt;BR /&gt;&lt;BR /&gt;''="missing"&lt;BR /&gt;&lt;BR /&gt;If so, try actually inserting a blank between the quotes:&lt;BR /&gt;&lt;BR /&gt;' '="missing"</description>
      <pubDate>Sun, 17 Mar 2019 07:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543776#M150337</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-17T07:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: freq of missing and non missing values for each field in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543811#M150352</link>
      <description>&lt;P&gt;the reason is because the name field for record 5 has a space.&amp;nbsp; so it is not null nor is it blank for the name field.&lt;/P&gt;
&lt;P&gt;try this code and do a proc&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value $missfmt
''="missing"
other="Non Missing";
value missfmt
.="missing"
other="Non Missing";
run;
data have;
set sashelp.class;
if _N_ in (2,5,8,13) then do;
  call missing(of _numeric_);
end;
if _N_ in (5,6,8,12) then do;
  call missing(of _character_);
end;
if substr(name,1,1)=" " then notblank = 1;
run;
proc freq  data=have ;
format _character_ $missfmt.;
tables _character_/missing missprint nocum nopercent;
format _numeric_ missfmt.;
tables _numeric_/missing missprint nocum nopercent;
run;
proc freq data=have;
tables notblank / missing;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;freq on the new variable notblank in the dataset have&lt;/P&gt;
&lt;TABLE class="table" style="border-collapse: collapse; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-spacing: 0px; color: #000000; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: 10.06px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1em; margin-left: auto; margin-right: auto; orphans: 2; text-align: center; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; border-width: 1px 0px 0px 1px; border-color: #c1c1c1; border-style: solid;" aria-label="One-Way Frequencies"&gt;
&lt;THEAD&gt;
&lt;TR style="border-bottom-color: #c1c1c1; border-bottom-style: solid; border-bottom-width: 0px; border-top-color: #c1c1c1; border-top-style: solid; border-top-width: 1px;"&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;notblank&lt;/TH&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR style="border-bottom-color: #c1c1c1; border-bottom-style: solid; border-bottom-width: 0px; border-top-color: #c1c1c1; border-top-style: solid; border-top-width: 1px;"&gt;
&lt;TH class="r rowheader" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="row"&gt;missing&lt;/TH&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="border-bottom-color: #c1c1c1; border-bottom-style: solid; border-bottom-width: 0px; border-top-color: #c1c1c1; border-top-style: solid; border-top-width: 1px;"&gt;
&lt;TH class="r rowheader" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="row"&gt;Non Missing&lt;/TH&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;TABLE class="table" style="border-collapse: collapse; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-spacing: 0px; color: #000000; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: 10.06px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1em; margin-left: auto; margin-right: auto; orphans: 2; text-align: center; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; border-width: 1px 0px 0px 1px; border-color: #c1c1c1; border-style: solid;" aria-label="One-Way Frequencies"&gt;
&lt;THEAD&gt;
&lt;TR style="border-bottom-color: #c1c1c1; border-bottom-style: solid; border-bottom-width: 0px; border-top-color: #c1c1c1; border-top-style: solid; border-top-width: 1px;"&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;notblank&lt;/TH&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;Percent&lt;/TH&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;Cumulative&lt;BR /&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: bottom; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="col"&gt;Cumulative&lt;BR /&gt;Percent&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR style="border-bottom-color: #c1c1c1; border-bottom-style: solid; border-bottom-width: 0px; border-top-color: #c1c1c1; border-top-style: solid; border-top-width: 1px;"&gt;
&lt;TH class="r rowheader" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="row"&gt;.&lt;/TH&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;15&lt;/TD&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;78.95&lt;/TD&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;15&lt;/TD&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;78.95&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="border-bottom-color: #c1c1c1; border-bottom-style: solid; border-bottom-width: 0px; border-top-color: #c1c1c1; border-top-style: solid; border-top-width: 1px;"&gt;
&lt;TH class="r rowheader" style="background-color: #edf2f9; color: #112277; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: bold; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #b0b7bb; border-style: solid; padding: 3px 6px 3px 6px;" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;4&lt;/TD&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;21.05&lt;/TD&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;19&lt;/TD&gt;
&lt;TD class="r data" style="background-color: #ffffff; font-family: Arial,&amp;amp;quot; albany amt&amp;amp;quot;,helvetica,helv; font-size: x-small; font-style: normal; font-weight: normal; text-align: right; vertical-align: top; border-width: 0px 1px 1px 0px; border-color: #c1c1c1; border-style: solid; padding: 3px 6px 3px 6px;"&gt;100.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sun, 17 Mar 2019 16:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543811#M150352</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-17T16:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: freq of missing and non missing values for each field in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543817#M150354</link>
      <description>&lt;P&gt;Use the FMTLIST option to PROC FORMAT to see what format you defined.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28001iE2009FA432ACBC03/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Because you did not include anything inside the quotes in your Value statement you ended up with a format for a string that consists of a single quote character instead of one for a blank string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;value $missfmt
  ' '='missing'
  other="Non Missing"
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Mar 2019 16:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543817#M150354</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-17T16:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: freq of missing and non missing values for each field in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543835#M150356</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; meant&lt;/P&gt;
&lt;P&gt;Use the FMTLIB option to PROC FORMAT to see what format you defined.&lt;/P&gt;
&lt;P&gt;not&lt;/P&gt;
&lt;P&gt;Use the FMTLIST option to PROC FORMAT to see what format you defined.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 21:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/freq-of-missing-and-non-missing-values-for-each-field-in-data/m-p/543835#M150356</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-03-17T21:20:07Z</dc:date>
    </item>
  </channel>
</rss>

