<?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: Subset dataset to categorical variables only in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812470#M320573</link>
    <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
    set sashelp.cars(keep=_character_);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 May 2022 19:00:08 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-05-10T19:00:08Z</dc:date>
    <item>
      <title>Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812469#M320572</link>
      <description>&lt;P&gt;I'm looking for a way to subset a dataset to only its categorical variables (or only continuous, doesn't matter) without knowing the names of the variables. So far haven't found anything that matches what I need. Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 18:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812469#M320572</guid>
      <dc:creator>dbjosiah</dc:creator>
      <dc:date>2022-05-10T18:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812470#M320573</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
    set sashelp.cars(keep=_character_);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 May 2022 19:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812470#M320573</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-10T19:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812471#M320574</link>
      <description>That's so simple it's embarrassing. Thanks.</description>
      <pubDate>Tue, 10 May 2022 19:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812471#M320574</guid>
      <dc:creator>dbjosiah</dc:creator>
      <dc:date>2022-05-10T19:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812472#M320575</link>
      <description>It you can assume categorical variables are character.&lt;BR /&gt;For example, cylinders in SASHELP.CARS is a categorical categorical variable but numeric.</description>
      <pubDate>Tue, 10 May 2022 19:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812472#M320575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-05-10T19:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812500#M320589</link>
      <description>Thanks Reeza. Once I have the real continuous ones out, I'm subsetting the long character ones by hand.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 May 2022 21:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812500#M320589</guid>
      <dc:creator>dbjosiah</dc:creator>
      <dc:date>2022-05-10T21:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812505#M320591</link>
      <description>&lt;P&gt;If you use SAS Studio, check out the characterize data set task. It does this automatically by looking at the # of distinct values within variables. Anything less than a threshold will be classified as categorical IIRC.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 22:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812505#M320591</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-05-10T22:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812506#M320592</link>
      <description>That would be useful! But I don't use Studio.</description>
      <pubDate>Tue, 10 May 2022 22:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812506#M320592</guid>
      <dc:creator>dbjosiah</dc:creator>
      <dc:date>2022-05-10T22:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812509#M320593</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/377938"&gt;@dbjosiah&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks Reeza. Once I have the real continuous ones out, I'm subsetting the long character ones by hand.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You could try NLEVELS output of PROC FREQ to quickly find the number of levels for each variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq nlevels data=have;
  tables _all_ / noprint;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 May 2022 22:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812509#M320593</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-10T22:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subset dataset to categorical variables only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812512#M320595</link>
      <description>I've used nlevels, but never like that! Much better than hand subsetting. Thanks!</description>
      <pubDate>Tue, 10 May 2022 23:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset-dataset-to-categorical-variables-only/m-p/812512#M320595</guid>
      <dc:creator>dbjosiah</dc:creator>
      <dc:date>2022-05-10T23:40:57Z</dc:date>
    </item>
  </channel>
</rss>

