<?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 Syntax to Print only Categorical variables only in a data set? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677183#M204258</link>
    <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the syntax to print only categorical variables in a dataset?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For eg: Syntax to print only numeric variables in a dataset is&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.cars;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2020 12:10:33 GMT</pubDate>
    <dc:creator>Guru_MG</dc:creator>
    <dc:date>2020-08-17T12:10:33Z</dc:date>
    <item>
      <title>Syntax to Print only Categorical variables only in a data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677183#M204258</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the syntax to print only categorical variables in a dataset?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For eg: Syntax to print only numeric variables in a dataset is&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.cars;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677183#M204258</guid>
      <dc:creator>Guru_MG</dc:creator>
      <dc:date>2020-08-17T12:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to Print only Categorical variables only in a data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677186#M204261</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var _character_;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677186#M204261</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-17T12:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to Print only Categorical variables only in a data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677204#M204266</link>
      <description>&lt;P&gt;SAS has two variable types. Floating point numbers and fixed length character strings. Whether a variable is categorical or not is something that SAS does not know.&amp;nbsp; You would have to tell it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The _NUMERIC_ variable list includes all of the numeric variables (whether they are "categorical" or not).&amp;nbsp; The _CHARACTER_ variable list includes all of the character variables (whether they have defined categories or are free text).&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677204#M204266</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-17T12:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to Print only Categorical variables only in a data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677208#M204267</link>
      <description>&lt;P&gt;Thank you very much Pagiemiller &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 12:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677208#M204267</guid>
      <dc:creator>Guru_MG</dc:creator>
      <dc:date>2020-08-17T12:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to Print only Categorical variables only in a data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677262#M204273</link>
      <description>&lt;P&gt;Since SAS doesn't know which variables are 'categorical' you might look into the Proc freq NLEVELS option&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods select nlevels;
proc freq data=sashelp.class nlevels;
run;&lt;/PRE&gt;
&lt;P&gt;As an example. The ODS SELECT option will have Proc Freq only display the NLEVELS table and not every single value of every single variable in the data set. &lt;/P&gt;
&lt;P&gt;This shows the number of different values a variable has. In this case AGE, which is numeric, shows 6 values and might be considered "categorical". Name, which has 19 values in 19 records seems like less a "category" than "free text". Sex, character with 2 levels, likely would be a category.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The common meanings of the variable name in the SASHELP.CLASS data set may be sufficient but this technique may be helpful exploring a new data set.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 14:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-to-Print-only-Categorical-variables-only-in-a-data-set/m-p/677262#M204273</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-17T14:46:33Z</dc:date>
    </item>
  </channel>
</rss>

