<?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: Where is not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816120#M322093</link>
    <description>&lt;P&gt;Since this is not a pass-thru application of PROC SQL, the responsibility for generating IDCT belongs to the sql procedure.&amp;nbsp; But WHERE filters are "outsourced" to the data retrieval engine, which is applied prior to the calculation of IDCT.&amp;nbsp; Hence, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;points out, the WHERE filter can not be applied to a calculated variable ... which means you will need to use her HAVING suggestion.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 21:49:42 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2022-06-01T21:49:42Z</dc:date>
    <item>
      <title>Where is not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816115#M322089</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
23         proc sql;
24         create table d
25         as select
26         name,
27         dob,
28         count (distinct id) as idct
29         from database
30         where calculated idct = "2"
31         group by name, dob;
ERROR: The following columns were not found as CALCULATED references in the immediate query: idct.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
32         quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I've tried with and without "calculated" and with and without quotes around the number; I'm just trying to get those with more than 1 as an idct so as to get those with duplicate data.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 01 Jun 2022 20:50:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816115#M322089</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-06-01T20:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Where is not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816117#M322090</link>
      <description>&lt;UL&gt;
&lt;LI&gt;Aggregated columns need to use HAVING not WHERE&lt;/LI&gt;
&lt;LI&gt;output type from a COUNT function is numeric, not character so quotes are not necessary around the 2&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This will likely work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;having count(distinct id) = 2&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290946"&gt;@bhca60&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
23         proc sql;
24         create table d
25         as select
26         name,
27         dob,
28         count (distinct id) as idct
29         from database
30         where calculated idct = "2"
31         group by name, dob;
ERROR: The following columns were not found as CALCULATED references in the immediate query: idct.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
32         quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I've tried with and without "calculated" and with and without quotes around the number; I'm just trying to get those with more than 1 as an idct so as to get those with duplicate data.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 20:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816117#M322090</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-01T20:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Where is not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816120#M322093</link>
      <description>&lt;P&gt;Since this is not a pass-thru application of PROC SQL, the responsibility for generating IDCT belongs to the sql procedure.&amp;nbsp; But WHERE filters are "outsourced" to the data retrieval engine, which is applied prior to the calculation of IDCT.&amp;nbsp; Hence, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;points out, the WHERE filter can not be applied to a calculated variable ... which means you will need to use her HAVING suggestion.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 21:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-is-not-working/m-p/816120#M322093</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-06-01T21:49:42Z</dc:date>
    </item>
  </channel>
</rss>

