<?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: Help with Where/Clause in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636568#M78115</link>
    <description>&lt;P&gt;Try do it&amp;nbsp; with 2 steps:&lt;/P&gt;
&lt;P&gt;1) use sql to create the joins, without any where clause for counting&lt;/P&gt;
&lt;P&gt;2) use the data step I posted as example&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2020 14:10:39 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2020-04-01T14:10:39Z</dc:date>
    <item>
      <title>Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636313#M78104</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have one table with many where clauses. I need to count a number of cases for each where clause.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;apply filter 1 how many cases was filtered, then I apply filter 2 and count the cases again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you guys!!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 31 Mar 2020 18:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636313#M78104</guid>
      <dc:creator>antoniodneto</dc:creator>
      <dc:date>2020-03-31T18:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636332#M78106</link>
      <description>&lt;P&gt;Am I right, you want to count number of observations (cases) per different conditions (where clause).&lt;/P&gt;
&lt;P&gt;You can do it in one step using IF statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have(end=eof);
      retain count1 count2 ...;
      if &amp;lt;condition-1&amp;gt; then count1+1;
      if &amp;lt;condition-2&amp;gt; then count2+1;
     ....
     if eof then do;
       output;  /* save result in a data set */
       put count1= count2= ...;  /* print result in log */
    end;
    keep count1 count2 ...;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 18:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636332#M78106</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-03-31T18:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636333#M78107</link>
      <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;Can I do it into a PROC SQL statement, because I have some joins inside.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 19:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636333#M78107</guid>
      <dc:creator>antoniodneto</dc:creator>
      <dc:date>2020-03-31T19:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636338#M78108</link>
      <description>&lt;P&gt;Please post:&lt;/P&gt;
&lt;P&gt;1) a test data of your table&lt;/P&gt;
&lt;P&gt;2) a pseudo code to show what you mean by join and some typical conditions&lt;/P&gt;
&lt;P&gt;3) relating to test data - show required results&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 19:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636338#M78108</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-03-31T19:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636339#M78109</link>
      <description>&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE TESTE AS&lt;BR /&gt;SELECT DISTINCT T1.*&lt;BR /&gt;FROM TESTE_2 T1&lt;/P&gt;&lt;P&gt;INNER JOIN TESTE_3 T2 ON T1.NAME = T2.NAME&lt;BR /&gt;INNER JOIN TESTE_4 T3 ON T1.NAME = T3.NAME&lt;BR /&gt;LEFT JOIN TESTE_5 t4 ON T1.NAME = T4.NAME&lt;BR /&gt;LEFT JOIN TESTE_6 T5 ON T1.NAME = T5.NAME&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;T3.NAME IS MISSING AND&lt;BR /&gt;T4.NAME IS MISSING AND&lt;BR /&gt;T5.NAME IS MISSING&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is my sample, So I need to count the cases for each filter:&lt;/P&gt;&lt;P&gt;Apply T3.NAME IS MISSING (count how many cases out for this filter) then apply the second (count again)....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It helps?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 19:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636339#M78109</guid>
      <dc:creator>antoniodneto</dc:creator>
      <dc:date>2020-03-31T19:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636469#M78112</link>
      <description>&lt;P&gt;You cannot count the discrete missing conditions from the joined table (because of the "AND").&lt;/P&gt;
&lt;P&gt;You need to get the counts separately for each joined table.&lt;/P&gt;
&lt;P&gt;Hint: because of the inner join, t3.name can only be missing if t1.name is missing.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 08:55:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636469#M78112</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-01T08:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636522#M78114</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you still help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks!!!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 13:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636522#M78114</guid>
      <dc:creator>antoniodneto</dc:creator>
      <dc:date>2020-04-01T13:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Where/Clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636568#M78115</link>
      <description>&lt;P&gt;Try do it&amp;nbsp; with 2 steps:&lt;/P&gt;
&lt;P&gt;1) use sql to create the joins, without any where clause for counting&lt;/P&gt;
&lt;P&gt;2) use the data step I posted as example&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 14:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-Where-Clause/m-p/636568#M78115</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-04-01T14:10:39Z</dc:date>
    </item>
  </channel>
</rss>

