<?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: How to select specific records in big data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720871#M27740</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID
date : $10.
test ;
cards;
1
5/21/2019
43
1
8/15/2019
12
1
10/16/2020
20
2
8/4/2019
10
2
12/2/1019
70
3
5/21/2019
7
3
8/15/2019
60
4
1/6/1019
21
4
5/23/2019
33
4
8/5/2019
57
;

proc sql;
create table want as
select a.id as id,b.id as id1 from
(select distinct id from have) as a natural left join
(select distinct id from have group by id having sum(test&amp;gt;60)=0) as b
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Feb 2021 11:02:20 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-02-22T11:02:20Z</dc:date>
    <item>
      <title>How to select specific records in big data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720538#M27711</link>
      <description>&lt;P&gt;I have a big data and I want to select specific records where the identified ID have a test result &amp;lt;=60 . I want to exclude if the subject "ID" has test result &amp;gt;60 during any time period from the analysis&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="392px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;date&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;test&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;5/21/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;43&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/15/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;12&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;10/16/2020&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;20&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/4/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;12/2/1019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;70&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;5/21/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/15/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;60&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;1/6/1019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;21&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;5/23/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;33&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/5/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;57&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want an output with ID that only have &amp;lt;=60&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="98"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="98"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="98"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 19 Feb 2021 18:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720538#M27711</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-19T18:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to select specific records in big data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720544#M27712</link>
      <description>&lt;P&gt;The simplest way might be to use SQL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select ID
from have
group by ID
having max(test) &amp;lt;= 60;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Feb 2021 19:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720544#M27712</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-02-19T19:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to select specific records in big data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720546#M27713</link>
      <description>&lt;P&gt;But if your data is already sorted by ID, a datastep should be faster:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
do until(last.ID);
	set have; by ID;
	t = max(t, test);
	end;
if t &amp;lt;= 60;
keep ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Feb 2021 19:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720546#M27713</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-02-19T19:29:40Z</dc:date>
    </item>
    <item>
      <title>SLECTING SPECIFC OBS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720599#M27716</link>
      <description>&lt;P&gt;I have a big data and I want to select specific records where the identified ID have a test result &amp;lt;=60 . I want to exclude if the subject "ID" has test result &amp;gt;60 during any time period from the analysis&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="392px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;date&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;test&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;5/21/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;43&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/15/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;12&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;10/16/2020&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;20&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/4/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;12/2/1019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;70&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;5/21/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/15/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;60&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;1/6/1019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;21&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;5/23/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;33&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="258px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="92px" height="30px"&gt;
&lt;P&gt;8/5/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="41px" height="30px"&gt;
&lt;P&gt;57&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want an output with ID that only have &amp;lt;=60&lt;/P&gt;
&lt;TABLE width="80px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;ID1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 19 Feb 2021 23:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720599#M27716</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-19T23:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to select specific records in big data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720643#M27722</link>
      <description>data have;&lt;BR /&gt;input ID&lt;BR /&gt;date : $10.&lt;BR /&gt;test ;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;5/21/2019&lt;BR /&gt;43&lt;BR /&gt;1&lt;BR /&gt;8/15/2019&lt;BR /&gt;12&lt;BR /&gt;1&lt;BR /&gt;10/16/2020&lt;BR /&gt;20&lt;BR /&gt;2&lt;BR /&gt;8/4/2019&lt;BR /&gt;10&lt;BR /&gt;2&lt;BR /&gt;12/2/1019&lt;BR /&gt;70&lt;BR /&gt;3&lt;BR /&gt;5/21/2019&lt;BR /&gt;7&lt;BR /&gt;3&lt;BR /&gt;8/15/2019&lt;BR /&gt;60&lt;BR /&gt;4&lt;BR /&gt;1/6/1019&lt;BR /&gt;21&lt;BR /&gt;4&lt;BR /&gt;5/23/2019&lt;BR /&gt;33&lt;BR /&gt;4&lt;BR /&gt;8/5/2019&lt;BR /&gt;57&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select distinct id&lt;BR /&gt; from have&lt;BR /&gt;  group by id&lt;BR /&gt;   having sum(test&amp;gt;60)=0;&lt;BR /&gt;quit;</description>
      <pubDate>Sat, 20 Feb 2021 11:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720643#M27722</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-02-20T11:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to select specific records in big data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720792#M27738</link>
      <description>&lt;P&gt;How do I still keep the ID and create a new ID variable for those who have test &amp;lt;=60?&lt;/P&gt;
&lt;P&gt;As in the table below,&amp;nbsp; want to keep the list of ID and have "ID1" as a new variable to represent the ones that have test &amp;lt;=60&lt;/P&gt;
&lt;P&gt;I want an output to look like this&lt;/P&gt;
&lt;TABLE width="80px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;ID1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="40px" height="30px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sun, 21 Feb 2021 22:11:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720792#M27738</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-21T22:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to select specific records in big data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720871#M27740</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID
date : $10.
test ;
cards;
1
5/21/2019
43
1
8/15/2019
12
1
10/16/2020
20
2
8/4/2019
10
2
12/2/1019
70
3
5/21/2019
7
3
8/15/2019
60
4
1/6/1019
21
4
5/23/2019
33
4
8/5/2019
57
;

proc sql;
create table want as
select a.id as id,b.id as id1 from
(select distinct id from have) as a natural left join
(select distinct id from have group by id having sum(test&amp;gt;60)=0) as b
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 11:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-specific-records-in-big-data/m-p/720871#M27740</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-02-22T11:02:20Z</dc:date>
    </item>
  </channel>
</rss>

