<?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: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ | in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633431#M21160</link>
    <description>&lt;P&gt;I think the simplest fix is to define a DATA VIEW that creates a character variable from YEAR, then use the VIEW in the PROC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have / view=Have;
length Year_Char $4;
set check;
Year_Char = put(YEAR, 4.);
drop YEAR;
run;

proc tabulate data=Have out=checkb;
class SITE_ID_ Year_Char;
table SITE_ID_ * _NUMERIC_ / rts=32;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Mar 2020 20:52:49 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-03-19T20:52:49Z</dc:date>
    <item>
      <title>Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633409#M21158</link>
      <description>&lt;P&gt;I am looking for a simple way to exclude one variable (YEAR) from the option of _NUMERIC_ , if possible, since I keep getting the following error:&amp;nbsp;&lt;FONT color="#FF0000"&gt;ERROR: Year appears in both CLASS and VAR list.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I have a lot of numeric variables that I want to see the SITE_ID_*_NUMERIC tabulation for, so I want to avoid having to list them all individually. Here is my code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc tabulate data=check out=check2b;&lt;BR /&gt;class Site_ID_ YEAR;&lt;BR /&gt;var&amp;nbsp; NUMERIC_&amp;nbsp; ;&lt;BR /&gt;table SITE_ID_*_NUMERIC_ / &lt;BR /&gt;rts=32;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 19:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633409#M21158</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2020-03-19T19:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633412#M21159</link>
      <description>&lt;P&gt;Can you use a different form of the shortcut list?&lt;/P&gt;
&lt;P&gt;For example, use the -- notation instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a reference that illustrates how to refer to variables and data sets in a short cut list:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option may be to use PROC MEANS? It looks like you're examining the distribution/counts of your variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633412#M21159</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-19T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633431#M21160</link>
      <description>&lt;P&gt;I think the simplest fix is to define a DATA VIEW that creates a character variable from YEAR, then use the VIEW in the PROC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have / view=Have;
length Year_Char $4;
set check;
Year_Char = put(YEAR, 4.);
drop YEAR;
run;

proc tabulate data=Have out=checkb;
class SITE_ID_ Year_Char;
table SITE_ID_ * _NUMERIC_ / rts=32;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Mar 2020 20:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633431#M21160</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-03-19T20:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633553#M21169</link>
      <description>I have way too many variables, but I did consider this thank you.</description>
      <pubDate>Fri, 20 Mar 2020 12:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633553#M21169</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2020-03-20T12:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633555#M21170</link>
      <description>I'm goign to try this right now, but this seems simple enough!</description>
      <pubDate>Fri, 20 Mar 2020 12:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633555#M21170</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2020-03-20T12:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633601#M21171</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The error message you're getting is that YEAR is numeric and you've listed it twice -- once in the CLASS statement, explicitly and once in the VAR statement implicitly with _NUMERIC_. So the issue is that you'd need to make YEAR a character variable, before the TABULATE in order to do what you want. Or else, you could do a query on Dictionary tables to get the names of the variables (without the class items) into a macro variable to use in the VAR statement. _NUMERIC_ is going to include YEAR. And one of the rules of PROC TABULATE is that a variable can only have one role -- CLASS or VAR and your code is making YEAR fall into both roles, which is an ERROR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 14:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633601#M21171</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-03-20T14:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude one variable from | PROC TABULATE VAR _NUMERIC_ |</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633676#M21175</link>
      <description>&lt;P&gt;You can always use a DATA SET OPTION drop or keep:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc tabulate data=check &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(drop= nameofunwantedvar)&lt;/FONT&gt; &lt;/STRONG&gt;out=check2b;&lt;BR /&gt;class Site_ID_ YEAR;&lt;BR /&gt;var NUMERIC_ ;&lt;BR /&gt;table SITE_ID_*_NUMERIC_ /&lt;BR /&gt;rts=32;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This form of drop means that for the duration of this proc ignore that variable (or variables) or alternatively use only the variables on a KEEP list. I haven't found a procedure this doesn't work with.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 16:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exclude-one-variable-from-PROC-TABULATE-VAR-NUMERIC/m-p/633676#M21175</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-20T16:42:56Z</dc:date>
    </item>
  </channel>
</rss>

