<?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: Excluding rows when two variables have specific values on the same row with PROC SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624607#M184029</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222220"&gt;@Sas_Act_114&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this in the inner select:&amp;nbsp;where NOT (Alpha = "C" and Beta = "X")&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 19:30:49 GMT</pubDate>
    <dc:creator>ErikLund_Jensen</dc:creator>
    <dc:date>2020-02-13T19:30:49Z</dc:date>
    <item>
      <title>Excluding rows when two variables have specific values on the same row with PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624583#M184020</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pulling data from a database using PROC SQL and there is a WHERE condition I am unsure on how to input. The pull is one table with several columns (variables) and I want to exclude rows when two of the columns have a specific value each.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example, call the columns Alpha and Beta. If in one row, Alpha has the value C and in that same row, Beta has the value X, I do not want that row in the pull. But if Alpha has the value C and Beta has any other value but X, or if Beta has the value X and Alpha has any other value but C, I do want those rows. Any help on this is appreciated, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 18:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624583#M184020</guid>
      <dc:creator>Sas_Act_114</dc:creator>
      <dc:date>2020-02-13T18:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding rows when two variables have specific values on the same row with PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624589#M184024</link>
      <description>&lt;P&gt;Some concrete example of the sources and then the desired result.&lt;/P&gt;
&lt;P&gt;In general SQL does not have a concept of "row order". There would have to be some other criteria provided to join the data on, or are you doing a full Cartesian Join of all rows from each table?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 18:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624589#M184024</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-13T18:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding rows when two variables have specific values on the same row with PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624593#M184025</link>
      <description>&lt;P&gt;Here are instructions on how to provide sample data as a data step:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 19:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624593#M184025</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-02-13T19:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding rows when two variables have specific values on the same row with PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624604#M184028</link>
      <description>&lt;P&gt;I apologize if I wasn't clear enough in the original post. There is no joins, I am simply pulling the data from one table, which even that I do not believe to be relevant. For all intensive purposes, this just involves one table (or dataset if you will) with several variables/columns in the one table. As an example of the table (with just 3 columns):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; Alpha&amp;nbsp; Beta&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;P&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;P&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I pull this table, I want it to keep rows 2, 3 and 4, excluding 1 and 5 due to the Alpha having C and Beta having X. The pull is very simple, it is simply (code edited with general table name and source):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CONNECT TO ODBC;
CREATE TABLE TEST1 AS
SELECT *
FROM CONNECTION TO ODBC
(
SELECT *
FROM SOURCE.TABLE&amp;nbsp;

);DISCONNECT FROM ODBC;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am looking for a where statement that will not include rows 1 and 5, as shown in the example above.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 19:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624604#M184028</guid>
      <dc:creator>Sas_Act_114</dc:creator>
      <dc:date>2020-02-13T19:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding rows when two variables have specific values on the same row with PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624607#M184029</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222220"&gt;@Sas_Act_114&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this in the inner select:&amp;nbsp;where NOT (Alpha = "C" and Beta = "X")&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 19:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624607#M184029</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2020-02-13T19:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding rows when two variables have specific values on the same row with PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624616#M184033</link>
      <description>This was the command I needed, worked perfectly, thank you.</description>
      <pubDate>Thu, 13 Feb 2020 19:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-rows-when-two-variables-have-specific-values-on-the/m-p/624616#M184033</guid>
      <dc:creator>Sas_Act_114</dc:creator>
      <dc:date>2020-02-13T19:49:04Z</dc:date>
    </item>
  </channel>
</rss>

