<?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: removing all the variables without any observations from my dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737922#M230097</link>
    <description>Great, thank you, Ksharp!</description>
    <pubDate>Thu, 29 Apr 2021 14:02:59 GMT</pubDate>
    <dc:creator>Emma_at_SAS</dc:creator>
    <dc:date>2021-04-29T14:02:59Z</dc:date>
    <item>
      <title>removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737641#M229989</link>
      <description>&lt;P&gt;I am checking the variables with missing observations in my dataset (using the code below). Now, I want to remove the variables that contain no observations from my dataset. I think about 10% of my variables are all missing observations. My sample size is 2100 and I have 1500 variables. I appreciate your suggestions. Thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data count_missing; set &amp;amp;dataset; run;

proc format;
 value $missfmt ' '='Missing' other='Not Missing';
 value  missfmt  . ='Missing' other='Not Missing';
run;
 
proc freq data=count_missing; 
format _CHAR_ $missfmt.; /* apply format for the duration of this PROC */
tables _CHAR_ / missing missprint nocum nopercent;
format _NUMERIC_ missfmt.;
tables _NUMERIC_ / missing missprint nocum nopercent;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 17:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737641#M229989</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-28T17:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737647#M229990</link>
      <description>&lt;P&gt;Example using SASHELP.ZIPMIL (which has lots of missings), using the NLEVELS option of PROC FREQ&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output nlevels=nlevels;
proc freq data=sashelp.zipmil nlevels; 
format _CHAR_ $missfmt.; /* apply format for the duration of this PROC */
tables _CHAR_ / missing missprint nocum nopercent;
format _NUMERIC_ missfmt.;
tables _NUMERIC_ / missing missprint nocum nopercent;
run;

proc sql noprint;
    select tablevar into :varnames separated by ' ' from nlevels where nnonmisslevels=0;
quit;

data want;
    set sashelp.zipmil(drop=&amp;amp;varnames);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 17:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737647#M229990</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-28T17:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737651#M229992</link>
      <description>&lt;P&gt;Also, your formats are not needed, even though I left them in the code.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 17:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737651#M229992</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-28T17:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737654#M229993</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I advise you to search the SAS-communities first to find your answer (before asking your question).&lt;/P&gt;
&lt;P&gt;It may save you some valuable time!&lt;/P&gt;
&lt;P&gt;This question, for example, is posted rather frequently.&lt;/P&gt;
&lt;P&gt;See for example:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Deleting Variables with Only Missing Values from Dataset with 4000+ Variables&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/Deleting-Variables-with-Only-Missing-Values-from-Dataset-with/td-p/494926" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/Deleting-Variables-with-Only-Missing-Values-from-Dataset-with/td-p/494926&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You will find multiple solutions there.&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 17:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737654#M229993</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-04-28T17:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737684#M229994</link>
      <description>Thank you, PaigeMiller. It works very well!</description>
      <pubDate>Wed, 28 Apr 2021 18:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737684#M229994</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-28T18:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737687#M229995</link>
      <description>Hi Koen,&lt;BR /&gt;Thank you, for your advice. Next time, I will search the previous posts more carefully.&lt;BR /&gt;Thanks,&lt;BR /&gt;Mary</description>
      <pubDate>Wed, 28 Apr 2021 18:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737687#M229995</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-28T18:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737895#M230092</link>
      <description>&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4737-2020.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4737-2020.pdf&lt;/A&gt;</description>
      <pubDate>Thu, 29 Apr 2021 13:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737895#M230092</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-29T13:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: removing all the variables without any observations from my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737922#M230097</link>
      <description>Great, thank you, Ksharp!</description>
      <pubDate>Thu, 29 Apr 2021 14:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-all-the-variables-without-any-observations-from-my/m-p/737922#M230097</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-29T14:02:59Z</dc:date>
    </item>
  </channel>
</rss>

