<?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: proc sql to get the desired records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621726#M182816</link>
    <description>&lt;P&gt;Can you simplify the logic to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select * from one where one='one' and two='two'
;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 02 Feb 2020 05:00:28 GMT</pubDate>
    <dc:creator>unison</dc:creator>
    <dc:date>2020-02-02T05:00:28Z</dc:date>
    <item>
      <title>proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621725#M182815</link>
      <description>&lt;P&gt;I have the following data set and I want to get the desire data set&lt;/P&gt;&lt;PRE&gt;data one; &lt;BR /&gt;input num name$ one$ two$ three$ four$ five $ ;&lt;BR /&gt;cards;&lt;BR /&gt;1 day1 NICE seeinn three four five&lt;BR /&gt;2 day1 one two three four3 five&lt;BR /&gt;3 day1 nice 1SEEInn2 GFL dlov dfdf &lt;BR /&gt;4 day23 one two thd ruhld hfdlhf&lt;BR /&gt;5 dfjdh Nice lseeinn fkdjf djfkd kjklj&lt;BR /&gt;6 dhhk one two dkfd alkdf aldkf&lt;BR /&gt;7 day1 ONE seeinn thde khf fllj&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get these record in my output :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 day1 one two three four3 five&lt;BR /&gt;4 day23 one two thd ruhld hfdlhf&lt;BR /&gt;6 dhhk one two dkfd alkdf aldkf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried following code, but wasn't successful getting the records I want.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table want as 
	select *
	from one
		where name not in ( select name from one where ((upcase(name)='DAY1' AND UPCASE(ONE)='NICE') OR (upcase(name)='DAY1' AND UPCASE(TWO) LIKE '%SEEINN%')));
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;THANKS IN ADVANCE&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 04:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621725#M182815</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2020-02-02T04:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621726#M182816</link>
      <description>&lt;P&gt;Can you simplify the logic to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select * from one where one='one' and two='two'
;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 02 Feb 2020 05:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621726#M182816</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-02-02T05:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621727#M182817</link>
      <description>&lt;P&gt;Thanks Unison for the reply. But that logic won't work for me. I created a dummy data set out of real data set. Yes, it would work for dummy data set that I provided. But that won't work. Sorry, but thanks anyway.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 05:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621727#M182817</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2020-02-02T05:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621728#M182818</link>
      <description>&lt;P&gt;I need to exclude the records with name (day1) along with field one (NICE) or name (day1) with field two (containing anything with seeinn), but contain all other records. I hope this helps with my criteria&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 05:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621728#M182818</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2020-02-02T05:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621729#M182819</link>
      <description>&lt;P&gt;I suggest pulling out the criteria in a separate select statement to test:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * from one 
where not(
	(upcase(name)='DAY1' AND UPCASE(ONE)='NICE') OR 
	(upcase(name)='DAY1' AND UPCASE(TWO) LIKE '%SEEINN%')
)
;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Based on your current logic, it looks like there is a case when NAME is&amp;nbsp;&lt;STRONG&gt;not&amp;nbsp;&lt;/STRONG&gt;DAY1 and two contains SEEINN.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 06:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621729#M182819</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-02-02T06:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621740#M182827</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/139130"&gt;@buddha_d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use the set operator 'EXCEPT' to select rows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table want as
	
	select *
	from one
	
	except
	
	select *
	from one
	where (upcase(name)='DAY1' and upcase(ONE)='NICE') or
	 	  (upcase(name)='DAY1' and upcase(TWO) like '%SEEINN%');
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 08:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/621740#M182827</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-02T08:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to get the desired records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/622096#M182967</link>
      <description>Thanks this works too</description>
      <pubDate>Tue, 04 Feb 2020 02:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-to-get-the-desired-records/m-p/622096#M182967</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2020-02-04T02:18:08Z</dc:date>
    </item>
  </channel>
</rss>

