<?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: Keep variables with different values among observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671804#M201791</link>
    <description>&lt;P&gt;The NLEVELS output of PROC FREQ will show you how many distinct values each variable has.&lt;/P&gt;
&lt;P&gt;You can use ODS OUTPUT to get the result into a dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output nlevels=nlevels;
proc freq data=carross1 nlevel;
  tables _all_ / noprint;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can now pull the list of names that mean you criteria into a macro variable using PROC SQL.&amp;nbsp; Either make a list of the ones to keep or the ones to delete and use the list in a KEEP or DROP statement (or dataset option).&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 12:54:34 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-07-23T12:54:34Z</dc:date>
    <item>
      <title>Keep variables with different values among observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671797#M201789</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I have this tiny table attached (3 observations) with a lot of variables. I'd like to keep only the variables for which there exists different values between at least 2 observations (or supress variables that have the same values for all the observations). Do you know a simple way to do this ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 12:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671797#M201789</guid>
      <dc:creator>Mathis1</dc:creator>
      <dc:date>2020-07-23T12:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Keep variables with different values among observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671804#M201791</link>
      <description>&lt;P&gt;The NLEVELS output of PROC FREQ will show you how many distinct values each variable has.&lt;/P&gt;
&lt;P&gt;You can use ODS OUTPUT to get the result into a dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output nlevels=nlevels;
proc freq data=carross1 nlevel;
  tables _all_ / noprint;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can now pull the list of names that mean you criteria into a macro variable using PROC SQL.&amp;nbsp; Either make a list of the ones to keep or the ones to delete and use the list in a KEEP or DROP statement (or dataset option).&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 12:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671804#M201791</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-23T12:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Keep variables with different values among observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671812#M201795</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=inputdata nodupkey;
by _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jul 2020 13:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-variables-with-different-values-among-observations/m-p/671812#M201795</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-23T13:19:36Z</dc:date>
    </item>
  </channel>
</rss>

