<?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: Drop variables that have only missing or null values in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218301#M16451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! This was just what I needed. I have been using a MUCH longer complex macro.&lt;/P&gt;&lt;P&gt;It's curious that SAS doesn't properly recognize the code for purposes of assigning correct&amp;nbsp; colors to the various lines.&lt;/P&gt;&lt;P&gt;Nonetheless, your code works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 14 Jun 2015 21:00:25 GMT</pubDate>
    <dc:creator>gerald_pulver_ucdenver_edu</dc:creator>
    <dc:date>2015-06-14T21:00:25Z</dc:date>
    <item>
      <title>Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218289#M16439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this kind of table and I would like to delete Header4 and Header6 which are containing only missing / null values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="114" style="border: 1px solid rgb(0, 0, 0); width: 472px; height: 116px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 4&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 5&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 6&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 7&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have few other tables to similar of this table, but not sure which columns are missing values. Can I use macro language to run this process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 22:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218289#M16439</guid>
      <dc:creator>JUN_Sands</dc:creator>
      <dc:date>2015-05-21T22:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218290#M16440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made this code some time ago. The macro takes a library in library=parameter and all the datasets inside. Checks for columns with all variables missing and does a copy of the table which is written to library in outlib=parameter. It also adds 'nomiss' string at the end of each table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the macro generates a lot of code, it is written to temporary external file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro new(library=,outlib=);&lt;/P&gt;&lt;P&gt;%local i j k;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select memname into :tables separated by " "&lt;/P&gt;&lt;P&gt;from dictionary.tables where libname="%upcase(&amp;amp;library.)";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do i = 1 %to %util_countwords(&amp;amp;tables.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table my_dictionary_columns as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select name, monotonic() as N from dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp; where memname="%scan(&amp;amp;tables,&amp;amp;i.)" and libname="%upcase(&amp;amp;library.)";&lt;/P&gt;&lt;P&gt;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; file 'temp.txt';&lt;/P&gt;&lt;P&gt; set my_dictionary_columns end=the_end;&lt;/P&gt;&lt;P&gt; put "retain miss" _N_" 0; miss" _N_"=missing";&lt;/P&gt;&lt;P&gt; put "(" name ")";&lt;/P&gt;&lt;P&gt; put&amp;nbsp; "+miss" _N_";keep miss" _N_";";&lt;/P&gt;&lt;P&gt; if the_end then call symputx('N_columns',_N_);&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /*&amp;nbsp; option symbolgen;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; data miss%scan(&amp;amp;tables,&amp;amp;i.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set %upcase(&amp;amp;library.).%scan(&amp;amp;tables,&amp;amp;i.) end=the_end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %include 'temp.txt';&lt;/P&gt;&lt;P&gt;&amp;nbsp; nasumeno+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; keep nasumeno;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if the_end then output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data concated;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set miss%scan(&amp;amp;tables,&amp;amp;i.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array misses&lt;LI&gt; miss: ;&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; keep i ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i = 1 to dim(misses);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if misses&lt;I&gt;/nasumeno=1 then do;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; check+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('check',check);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table to_delete as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select a.name&lt;/P&gt;&lt;P&gt;&amp;nbsp; from my_dictionary_columns as a inner join concated as b on(a.N=b.i)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file 'drop_temp.txt';&lt;/P&gt;&lt;P&gt;&amp;nbsp; set to_delete;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put "drop " name ";";&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;/****************************************************************************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp; data &amp;amp;outlib..%substr(%scan(&amp;amp;tables,&amp;amp;i.),1,%sysfunc(min(27,%length(%scan(&amp;amp;tables,&amp;amp;i.)))))nomis;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set %upcase(&amp;amp;library.).%scan(&amp;amp;tables,&amp;amp;i.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if &amp;amp;check.&amp;gt;0 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %include 'drop_temp.txt';&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put &amp;amp;check. variables removed due to missing values from %upcase(&amp;amp;library.).%scan(&amp;amp;tables,&amp;amp;i.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put no missing data discovered in table %upcase(&amp;amp;library.).%scan(&amp;amp;tables,&amp;amp;i.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend new;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%new(outlib=&amp;amp;outlib.,library=&amp;amp;library.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Jakub&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 12:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218290#M16440</guid>
      <dc:creator>chrej5am</dc:creator>
      <dc:date>2015-05-22T12:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218291#M16441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite simple really, normalise your data, then take variables with missing sum, then drop that list:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile datalines dlm="," dsd missover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Header1 Header2 Header3 Header4 Header5 Header6 Header7;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1,3,1,,5,,3&lt;/P&gt;&lt;P&gt;2,4,6,,6,,4&lt;/P&gt;&lt;P&gt;3,5,7,,3,,6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inter (keep=head val_res);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array header{7};&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; head="HEADER"||strip(put(i,best.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; val_res=header{i};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; distinct HEAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp; :DROP_LIST separated by " "&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; WORK.INTER&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by HEAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; having&amp;nbsp; sum(VAL_RES)=.;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have (drop=&amp;amp;DROP_LIST.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 12:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218291#M16441</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-22T12:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218292#M16442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If all the variables are numeric why all the extra processing?.&amp;nbsp; You can get Ns directly and done.&amp;nbsp; The more difficult question is how do you do this efficiently for data with both character and numeric variables and a large number of obs.&amp;nbsp; Once you find the first non-missing for a variable you can stop looking at that variable but variables with all missing values every observations must be tested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;none&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;means&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;n&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; stackods &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=have;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; summary=summary(where=(n=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;));&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;all&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;IMG __jive_id="10552" alt="5-22-2015 8-45-05 AM.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/10552_5-22-2015 8-45-05 AM.png" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218292#M16442</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-05-22T13:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218293#M16443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This topic has been heavily talked . If your data are all numeric type , this could easily been done by the following.&lt;/P&gt;&lt;P&gt;But I would like to use SQL which can also take care CHARACTER type variable and more control .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
data have;
&amp;nbsp; infile datalines dlm="," dsd missover;
&amp;nbsp; input Header1 Header2 Header3 Header4 Header5 Header6 Header7;
datalines;
1,3,1,,5,,3
2,4,6,,6,,4
3,5,7,,3,,6
;
run;
ods select none;
ods output nlevels=want(where=(NNonMissLevels=0));
proc freq data=have nlevels;
tables _numeric_;
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="x.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/10554_x.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 15:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218293#M16443</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-22T15:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218294#M16444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My dataset, it is all character type.. Sorry, I should have mentioned at the beginning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 15:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218294#M16444</guid>
      <dc:creator>JUN_Sands</dc:creator>
      <dc:date>2015-05-22T15:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218295#M16445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, with a minor change to my code it should handle character:&lt;/P&gt;&lt;P&gt;data inter (keep=head val_res);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array header{7};&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; head="HEADER"||strip(put(i,best.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if strip(header{i})="" then val_res=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else val_res=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; distinct HEAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp; :DROP_LIST separated by " "&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; WORK.INTER&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by HEAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; having&amp;nbsp; sum(VAL_RES)=0;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have (drop=&amp;amp;DROP_LIST.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note I am not at work so can't test.&amp;nbsp; A similar approach could do both char and numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 16:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218295#M16445</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-22T16:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218296#M16446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. Actually I have already posted such code for many posts .&lt;/P&gt;&lt;P&gt;OR if you like IML , you also could get it ,and IML is very fast . But IML only can deal with the variables which are all NUM or CHAR .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
 
data have;
&amp;nbsp; infile datalines dlm="," dsd missover;
&amp;nbsp; input (Header1 Header2 Header3 Header4 Header5 Header6 Header7) ($);
datalines;
1,3,1,,5,,3
2,4,6,,6,,4
3,5,7,,3,,6
;
run;
proc transpose data=have(obs=0) out=vname ;
 var _all_;
run;

proc sql;
 select catx(' ','n(',_name_,') as ',_name_) into : list separated by ',' from vname;
 create table temp as
&amp;nbsp; select &amp;amp;list from have;
quit;

proc transpose data=temp out=drop ;
 var _all_;
run;

proc sql;
 select _name_ into : drop separated by ' ' from drop where col1=0;
quit;

data want;
 set have(drop=&amp;amp;drop);
run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2015 04:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218296#M16446</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-23T04:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218297#M16447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IML code for such question. Since you start such a topic, I just wrote some IML code for this . IML is very fast, Rick might want see this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
 
data have;
&amp;nbsp; infile datalines dlm="," dsd missover;
&amp;nbsp; input (Header1 Header2 Header3 Header4 Header5 Header6 Header7) ($);
datalines;
1,3,1,,5,,3
2,4,6,,6,,4
3,5,7,,3,,6
;
run;

proc iml;
use have;
read all var _char_ into x[c=vname];
drop= vname[loc(missing(x)[+,]=nrow(x))];
submit drop;
 data want;
&amp;nbsp; set have(drop=&amp;amp;drop);
 run;
endsubmit;
quit;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2015 04:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218297#M16447</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-23T04:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218298#M16448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much!! That works perfect, but PROC IML can't be run in SAS enterprise guide?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2015 19:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218298#M16448</guid>
      <dc:creator>JUN_Sands</dc:creator>
      <dc:date>2015-05-25T19:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218299#M16449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah. But you can run it in SAS University Edition which is totally free , you can downlaod it from sas.com&amp;nbsp; .&lt;/P&gt;&lt;P&gt;And one more thing , You could also try my PROC FREQ code&amp;nbsp; Like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables&amp;nbsp; _char_ ;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;tables _all_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 12:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218299#M16449</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-26T12:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218300#M16450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can run IML code in EG as long as you have it .&lt;/P&gt;&lt;P&gt;Run&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc setinit;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check if you have IML .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 13:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218300#M16450</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-26T13:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables that have only missing or null values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218301#M16451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! This was just what I needed. I have been using a MUCH longer complex macro.&lt;/P&gt;&lt;P&gt;It's curious that SAS doesn't properly recognize the code for purposes of assigning correct&amp;nbsp; colors to the various lines.&lt;/P&gt;&lt;P&gt;Nonetheless, your code works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Jun 2015 21:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Drop-variables-that-have-only-missing-or-null-values/m-p/218301#M16451</guid>
      <dc:creator>gerald_pulver_ucdenver_edu</dc:creator>
      <dc:date>2015-06-14T21:00:25Z</dc:date>
    </item>
  </channel>
</rss>

