<?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 do I detect and subset non-missing observations in repeated data (missing -&amp;gt; non-missing) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709107#M217973</link>
    <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, thanks for the response! I tested your code but I think the proc sort at the start removed all the missing data &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I think I'd still want to keep the missing data if the ID has all their rows missing. However, it did fix the issue of the T2 being missing but T1 as not. Will try to test out and see if I can adjust this if anything. Thanks again.</description>
    <pubDate>Sat, 02 Jan 2021 23:28:57 GMT</pubDate>
    <dc:creator>asgee</dc:creator>
    <dc:date>2021-01-02T23:28:57Z</dc:date>
    <item>
      <title>How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709104#M217970</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have some repeated measures data where each ID could potentially have 2 rows of data. A sample is shown below.&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="216px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;Time&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;Data&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;1234&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;1234&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;5555&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;6777&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;9876&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;9876&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;1000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;2000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;8888&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;8888&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;9000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;9000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;1010&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="101px" height="30px"&gt;
&lt;P&gt;1010&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60px" height="30px"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;.&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'm trying to reduce each ID down to 1 observation each. The criteria is that I'm prioritizing their data on Time 2 (Time=T2). So if they have non-missing data on T2, I pick that row as that ID's observation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the code below to re-sort the data in descending "Time", so that the row where Time=T2 appears first. After that, it's easy for me to just take the first row (which should be the T2 row if they have 2 rows of data) as the observation for each ID.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=test;
by ID descending time;
run;
	
data want;
set test;
by ID;
if first.ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My issue now are the data where they have&amp;nbsp;&lt;STRONG&gt;missing&amp;nbsp;data on T2, but &lt;U&gt;not on T1&lt;/U&gt;&lt;/STRONG&gt;. Looking at the sample data, if I proceeded with my code above ^, the ID "9000" (as well as ID 8888), would have their T2 observation picked where "Data" is missing. However, when you look at their T1 observation, ID 9000 has existing Data in T1 that's "0".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Non-missing&lt;/U&gt;&amp;nbsp;data would mean like any value that's not ".". Therefore, Data=0 would count as non-missing data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, if the ID has 2 rows, prioritize picking their &lt;U&gt;T2&amp;nbsp;row&lt;/U&gt; - &lt;STRONG&gt;if&lt;/STRONG&gt; &lt;STRONG&gt;there's data&lt;/STRONG&gt;. If there isn't, look at their &lt;U&gt;T1 row&lt;/U&gt; -&amp;nbsp;&lt;STRONG&gt;if there is data, pick that row instead.&lt;/STRONG&gt; If all rows for Data are missing for that ID, then stick with picking their T2 row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to hopefully produce a table like the one below:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;Time&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;Data&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;1234&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;5555&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;6777&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;9876&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;1000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;2000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;8888&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="102"&gt;
&lt;P&gt;9000&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="60"&gt;
&lt;P&gt;T1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;1010&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;T2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;.&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;Any help would be very much appreciated, thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 23:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709104#M217970</guid>
      <dc:creator>asgee</dc:creator>
      <dc:date>2021-01-02T23:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709105#M217971</link>
      <description>&lt;P&gt;I didn't test this, but you can. I am 99.998% sure it will work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=test(where=(not missing(data))) out=test1;
by ID descending time;
run;
	
data want;
set test1;
by ID;
if first.ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 22:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709105#M217971</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-02T22:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709106#M217972</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/308380"&gt;@asgee&lt;/a&gt;&amp;nbsp; Fun SQL stuff-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data have;
input ID	Time $	Data;
cards;
1234	T1	.
1234	T2	31
5555	T1	10
6777	T2	.
9876	T1	64
9876	T2	12
1000	T1	43
2000	T2	9
8888	T1	40
8888	T2	.
9000	T1	90
9000	T2	.
;

proc sql;
 create table want(drop=_n_) as
 select *,  max(Time='T2' and data) as _n_
 from have
 group by id
 having _n_  and Time='T2' or not _n_ and time='T1' 
 or  count(distinct time)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jan 2021 22:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709106#M217972</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-02T22:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709107#M217973</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, thanks for the response! I tested your code but I think the proc sort at the start removed all the missing data &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I think I'd still want to keep the missing data if the ID has all their rows missing. However, it did fix the issue of the T2 being missing but T1 as not. Will try to test out and see if I can adjust this if anything. Thanks again.</description>
      <pubDate>Sat, 02 Jan 2021 23:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709107#M217973</guid>
      <dc:creator>asgee</dc:creator>
      <dc:date>2021-01-02T23:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709108#M217974</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;, thanks for the response! The code appears to work through all of the criteria, however I think it flips the last criteria where if the ID has two observations with existing data (T1 and T2 are non-missing). &lt;BR /&gt;&lt;BR /&gt;My fault for not mentioning that the original "Data" variable has values in the format of (0, 1 or .). So for example: &lt;BR /&gt;- If you were to change the data on ID 9876 to have two rows of non-missing data on both T1 and T2, but those data are "0" (meaning T1=0, T2=0). They'd be considered "non-missing" as they're not "."&lt;BR /&gt;-When I ran your code, I think for ID's like these, it prioritized picking the T1 row instead of the T2 row. I guess since both rows were 0, it instead picked the first in line. &lt;BR /&gt;&lt;BR /&gt;Otherwise, the code works perfectly when selecting the issue of T2 being missing, but T1 isn't (i.e. the ID 9000 issue). It also picks up the ID's with only single rows. &lt;BR /&gt;&lt;BR /&gt;I'll keep testing out your code and see if I can adjust it. Maybe its just a resorting error on my end... Thanks again.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 23:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709108#M217974</guid>
      <dc:creator>asgee</dc:creator>
      <dc:date>2021-01-02T23:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709109#M217975</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; I've edited my question above to reflect the "Data" variable. Perhaps the values being (0,1 or .) make a big difference...</description>
      <pubDate>Sat, 02 Jan 2021 23:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709109#M217975</guid>
      <dc:creator>asgee</dc:creator>
      <dc:date>2021-01-02T23:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709110#M217976</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/308380"&gt;@asgee&lt;/a&gt;&amp;nbsp; Please post the best representative sample so that we don't have to go back and forth. Of course, it may take some time to prepare a mock data, however it's worth spending some time to think through carefully before posting the data, so that we are done in one shot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw, no worries it's no biggie-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
 create table want(drop=_n_) as
 select *,  max(Time='T2' and data&amp;gt;.) as _n_
 from have
 group by id
 having _n_  and Time='T2' or  not _n_ and time='T1' 
 or count(distinct time)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jan 2021 23:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709110#M217976</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-02T23:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709111#M217977</link>
      <description>Thanks so much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;, yes I realized my mistake afterwards - my apologies for that &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; . The code above works perfectly, really appreciate your help! Will be more wary the next time I post. &lt;BR /&gt;&lt;BR /&gt;Thanks again! &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 03 Jan 2021 00:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709111#M217977</guid>
      <dc:creator>asgee</dc:creator>
      <dc:date>2021-01-03T00:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709112#M217978</link>
      <description>&lt;P&gt;And just to account for -"&lt;STRONG&gt;If all rows for Data are missing for that ID, then stick with picking their T2 row. " May be this is more prudent-&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
 create table want(drop=_n_) as
 select *,  max(Time='T2' and data&amp;gt;.) as _n_
 from have
 group by id
 having _n_  and Time='T2' or  not _n_ and time='T1' and n(data)
 or  not _n_ and time='T2' and n(data)=0
 or count(distinct time)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Jan 2021 00:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709112#M217978</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-03T00:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709113#M217979</link>
      <description>Thanks for this! The code works great and accounts for that as well, thanks again &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;! Really appreciate the help.</description>
      <pubDate>Sun, 03 Jan 2021 00:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709113#M217979</guid>
      <dc:creator>asgee</dc:creator>
      <dc:date>2021-01-03T00:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I detect and subset non-missing observations in repeated data (missing -&gt; non-missing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709123#M217989</link>
      <description>&lt;PRE&gt;data have;
input ID	Time $	Data;
cards;
1234
T1
1
1234
T2
1
5555
T1
0
6777
T2
.
9876
T1
0
9876
T2
0
1000
T1
1
2000
T2
1
8888
T1
1
8888
T2
.
9000
T1
0
9000
T2
.
1010
T1
.
1010
T2
.
;

data temp;
 set have;
 missing=missing(data);
run;
proc sort data=temp;by id descending missing time;run;
data want;
 set temp;
 by id;
 if last.id;
run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Jan 2021 03:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-detect-and-subset-non-missing-observations-in-repeated/m-p/709123#M217989</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-03T03:58:33Z</dc:date>
    </item>
  </channel>
</rss>

