<?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: using sql to check missing rate for a long list of variables in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402796#M25850</link>
    <description>&lt;P&gt;I have two examples here, neither use SQL though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This uses PROC FREQ and formats.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111" target="_blank"&gt;https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an older method, the one above is more efficient:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/c3a9ddcb002c469e9d61" target="_blank"&gt;https://gist.github.com/statgeek/c3a9ddcb002c469e9d61&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 15:12:35 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-10T15:12:35Z</dc:date>
    <item>
      <title>using sql to check missing rate for a long list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402788#M25849</link>
      <description>&lt;P&gt;I want to check the missing rate for a long list of variables, about 800 variables.&lt;/P&gt;&lt;P&gt;Below is my code by using the sashelp dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code produce two tables mmm4 and mmm5 and show the result. Is there any way I can get one table to have the missing rates for all variables? ( And I don't want the results to be in report form by deleting the create table line&lt;img id="womanembarrassed" class="emoticon emoticon-womanembarrassed" src="https://communities.sas.com/i/smilies/16x16_woman-embarrassed.png" alt="Woman Embarassed" title="Woman Embarassed" /&gt;)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  set sashelp.class;
  if _n_ in (5,10,12) then do;
    call missing(height,weight);
  end;
  call missing(age);
run;
proc sql ;
 select name into : list separated by ' '
  from dictionary.columns
   where libname='WORK' and memname='HAVE';
quit;


%macro horizon;
%local i item;
%*write the horizontal list;
%do I=4 %TO 5;
  %let item=%qscan(&amp;amp;list,&amp;amp;i,' ');
  %put item&amp;amp;i is &amp;amp;item;
proc sql;
create table mmm_&amp;amp;i as
select count(case when (&amp;amp;item =.)then 1 end) as &amp;amp;item
from have;
quit;
%end;
%mend horizon;
%horizon&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402788#M25849</guid>
      <dc:creator>zzzyyy</dc:creator>
      <dc:date>2017-10-10T15:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: using sql to check missing rate for a long list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402796#M25850</link>
      <description>&lt;P&gt;I have two examples here, neither use SQL though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This uses PROC FREQ and formats.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111" target="_blank"&gt;https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an older method, the one above is more efficient:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/c3a9ddcb002c469e9d61" target="_blank"&gt;https://gist.github.com/statgeek/c3a9ddcb002c469e9d61&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402796#M25850</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T15:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: using sql to check missing rate for a long list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402811#M25852</link>
      <description>&lt;P&gt;Thank you very much! Your two examples help a lot!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/402811#M25852</guid>
      <dc:creator>zzzyyy</dc:creator>
      <dc:date>2017-10-10T15:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: using sql to check missing rate for a long list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/403182#M25878</link>
      <description>&lt;P&gt;Here is an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  set sashelp.class;
  if _n_ in (5,10,12) then do;
    call missing(height,weight);
  end;
  call missing(age);
run;


 
proc format;
 value fmt
  ._-.z='missing'
  other='nonmiss';
 value $fmt
  ' '='missing'
  other='nonmiss';
run;
proc freq data=have;
table _all_/missing;
format _numeric_ fmt. _character_ $fmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2017 14:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/using-sql-to-check-missing-rate-for-a-long-list-of-variables/m-p/403182#M25878</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-11T14:22:46Z</dc:date>
    </item>
  </channel>
</rss>

