<?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: count missings for all character variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671491#M201661</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/118286"&gt;@Xiaoyi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; Thanks for the code this look promising, but it only did for one variable. I had 37 character variables. I tried to tweak it a little bit to make it work, but I run it, and every time, it only counted one variables. It didn't give me a dataset with 37 variables in it. You can use any datasets you have to test it.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Check the post with the code for the added OUTPUT statement.&lt;/P&gt;
&lt;P&gt;The problem with not having a data set is code cannot be tested...&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 17:40:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-07-22T17:40:17Z</dc:date>
    <item>
      <title>count missings for all character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671471#M201653</link>
      <description>&lt;P&gt;Dear SAS experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to just count missing frequency for all character variables by a categorical var (Year) in a dataset.&amp;nbsp; and have a output dataset. I only care about the missing count, so leave the not missing out. and I only want the character variables, so don't try to conquer all var in one shot and expect perfect results. (I've searched and tried, hasn't found one), but you do have a perfect solution that can do it all (by category and with results output), I think everyone would love to have it :). Keep it separate and keep it simple. Thanks.&lt;/P&gt;
&lt;P&gt;The following is a simple code to do the numeric variable FYI. I want similar results for character variables:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=sensit_dist nway noprint; &lt;BR /&gt;class infyob_yot; &lt;BR /&gt;output out=misschk n= nmiss= /autoname; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 17:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671471#M201653</guid>
      <dc:creator>Xiaoyi</dc:creator>
      <dc:date>2020-07-22T17:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: count missings for all character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671476#M201656</link>
      <description>&lt;P&gt;Something like this may get you started. Untested as we don't have your data.&lt;/P&gt;
&lt;P&gt;The Value in the data step takes 1/0 values when the variable is missing for the named variable. This creates one record for each variable. The Proc summary/means sums the variable to get a total count of missing.&lt;/P&gt;
&lt;PRE&gt;data temp;
   set sensit_dist;
   array c _character_;&lt;BR /&gt;   length name $ 32;
   do i=1 to dim (c);
      name = vname(c[i]);
      value = (missing( c[i]));&lt;BR /&gt;      output;
   end;
   keep  infyob_yot name value ;
run;

proc summary data=temp nway;
   class infyob_yot name;
   var value;
   output out=work.charmissing Sum= ;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 17:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671476#M201656</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-22T17:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: count missings for all character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671485#M201659</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; Thanks for the code this look promising, but it only did for one variable. I had 37 character variables. I tried to tweak it a little bit to make it work, but I run it, and every time, it only counted one variables. It didn't give me a dataset with 37 variables in it. You can use any datasets you have to test it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 17:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671485#M201659</guid>
      <dc:creator>Xiaoyi</dc:creator>
      <dc:date>2020-07-22T17:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: count missings for all character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671491#M201661</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/118286"&gt;@Xiaoyi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; Thanks for the code this look promising, but it only did for one variable. I had 37 character variables. I tried to tweak it a little bit to make it work, but I run it, and every time, it only counted one variables. It didn't give me a dataset with 37 variables in it. You can use any datasets you have to test it.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Check the post with the code for the added OUTPUT statement.&lt;/P&gt;
&lt;P&gt;The problem with not having a data set is code cannot be tested...&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 17:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-missings-for-all-character-variable/m-p/671491#M201661</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-22T17:40:17Z</dc:date>
    </item>
  </channel>
</rss>

