<?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: _numeric_, _character_ and _all_ in a where dataset option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748671#M235144</link>
    <description>&lt;P&gt;You can use a subsetting IF statement instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
   set test;
   if sum(of _NUMERIC_)=. and clientid=cats(of _CHARACTER_);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 Jun 2021 12:49:15 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-06-17T12:49:15Z</dc:date>
    <item>
      <title>_numeric_, _character_ and _all_ in a where dataset option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748654#M235136</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was expecting _numeric_, _character_ and _all_ to work everywhere but it doesn't seem to work in the where dataset option. Did I miss something?&lt;/P&gt;&lt;P&gt;SAS Online Doc: &lt;A href="https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000695105.htm" target="_blank" rel="noopener"&gt;https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000695105.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    clientid='123'; a=' '; b=' '; c=' '; x=.; y=.; z=.; output;
    clientid='124'; a=' '; b='b'; c=' '; x=.; y=.; z=.; output;
    clientid='125'; a=' '; b=' '; c=' '; x=.; y=1; z=.; output;
    clientid='126'; a='a'; b=' '; c=' '; x=.; y=.; z=2; output;
run;

*works
data test1;
    set test;
    if sum(of _numeric_)=. and clientid=cats(of _character_);
run;

*does not work;
data test2;
    set test (where=(sum(of _numeric_)=. and subjid=cats(of _character_))));
run;


proc print data=test1 noobs;
run;
proc print data=test2 noobs;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Véronique&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 11:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748654#M235136</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2021-06-17T11:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: _numeric_, _character_ and _all_ in a where dataset option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748662#M235141</link>
      <description>&lt;P&gt;Hi Véronique (&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184742"&gt;@xxformat_com&lt;/a&gt;),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the reason is actually that the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/n1t04bwpt1jkadn1a5mk35we2yif.htm" target="_blank" rel="noopener"&gt;OF operator&lt;/A&gt; is not available in WHERE statements and WHERE= dataset options (probably because these are closely related to the WHERE clause in PROC SQL), i.e., with WHERE(=) the OF operator doesn't even work with a single variable as in &lt;FONT face="courier new,courier"&gt;sum(of x)&lt;/FONT&gt;.&amp;nbsp;&lt;SPAN&gt;For a complete list of the available operators, see&amp;nbsp;&lt;/SPAN&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1xbr9r0s9veq0n137iftzxq4g7e.htm#n0xj2ds84r7zqyn1h2n50h959xhh" target="_blank"&gt;WHERE Statement Operators&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 12:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748662#M235141</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-06-17T12:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: _numeric_, _character_ and _all_ in a where dataset option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748671#M235144</link>
      <description>&lt;P&gt;You can use a subsetting IF statement instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
   set test;
   if sum(of _NUMERIC_)=. and clientid=cats(of _CHARACTER_);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jun 2021 12:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748671#M235144</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-06-17T12:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: _numeric_, _character_ and _all_ in a where dataset option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748673#M235146</link>
      <description>&lt;P&gt;OF is a construct handled by the data step compiler only; the dataset options (and WHERE statements) are dealt with by the library engine, which is more or less SQL-like, and does not have the OF. To a WHERE= or WHERE, OF is just a variable name.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 12:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748673#M235146</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-17T12:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: _numeric_, _character_ and _all_ in a where dataset option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748675#M235147</link>
      <description>&lt;P&gt;The `WHERE` statement and the `WHERE=` data set option are executed "outside" of the Program Data Vector.&lt;/P&gt;
&lt;P&gt;The condition can be only executed against explicitly listed variables from the data set (not from the PDV).&lt;/P&gt;
&lt;P&gt;The `_numeric_` variables list requires the PDV to&amp;nbsp; verify what numeric variables are available, similarly as the `a1-a10` or `x -- y` variables lists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, since "there is no PDV existing" when WHERE and WHERE= are executed, then the `_numeric_` cannot be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 13:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/numeric-character-and-all-in-a-where-dataset-option/m-p/748675#M235147</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-06-17T13:02:24Z</dc:date>
    </item>
  </channel>
</rss>

