<?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: Comparing rows by variable HELP in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Comparing-rows-by-variable-HELP/m-p/73412#M1675</link>
    <description>Hello Rfergs,&lt;BR /&gt;
&lt;BR /&gt;
I am not sure that understood what you really need. I mean do you want to exclude some observations or simply mark them with 1 or 0? Anyway this how to exclude them:&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
  input bu 1-2 Name $ 3-10 Age $ 11-13;&lt;BR /&gt;
	datalines;&lt;BR /&gt;
1 Steve   Old&lt;BR /&gt;
4 Mike    Old&lt;BR /&gt;
2 Steve   Old&lt;BR /&gt;
6 Steve   Old&lt;BR /&gt;
7 Lisa    New&lt;BR /&gt;
3 Mike    New&lt;BR /&gt;
5 Mike    New&lt;BR /&gt;
8 Lisa    New&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=b;&lt;BR /&gt;
  by name age;&lt;BR /&gt;
run;&lt;BR /&gt;
data r;&lt;BR /&gt;
  retain t;&lt;BR /&gt;
  set b;&lt;BR /&gt;
	if first.name then t=age;&lt;BR /&gt;
  if last.name and t=age then output;&lt;BR /&gt;
  by name;&lt;BR /&gt;
	drop t;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
    <pubDate>Mon, 25 Oct 2010 20:52:10 GMT</pubDate>
    <dc:creator>SPR</dc:creator>
    <dc:date>2010-10-25T20:52:10Z</dc:date>
    <item>
      <title>Comparing rows by variable HELP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Comparing-rows-by-variable-HELP/m-p/73411#M1674</link>
      <description>I am trying to analyze some data on blood unit age and usage, and am having problems figuring out the code for what I want to do!&lt;BR /&gt;
&lt;BR /&gt;
I have Blood unit number, Patients name, the age of the RBC unit&lt;BR /&gt;
&lt;BR /&gt;
Some people got more than one unit.There names are duplicated each time they receive a unit of blood, beside that new units number. So some people have their names entered more than once.&lt;BR /&gt;
Because I am analyzing this by age of unit, I want to exclude people that received more than one unit of  blood with different ages (ie its ok if they got two units that are both 'new' but not ok if they got one that is 'new' and one that is 'old', I want to delete them)&lt;BR /&gt;
I want to create a variable that is '1' for people with blood all of the same age, 0 for those that received mixed blood.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas??</description>
      <pubDate>Mon, 20 Sep 2010 16:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Comparing-rows-by-variable-HELP/m-p/73411#M1674</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-20T16:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rows by variable HELP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Comparing-rows-by-variable-HELP/m-p/73412#M1675</link>
      <description>Hello Rfergs,&lt;BR /&gt;
&lt;BR /&gt;
I am not sure that understood what you really need. I mean do you want to exclude some observations or simply mark them with 1 or 0? Anyway this how to exclude them:&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
  input bu 1-2 Name $ 3-10 Age $ 11-13;&lt;BR /&gt;
	datalines;&lt;BR /&gt;
1 Steve   Old&lt;BR /&gt;
4 Mike    Old&lt;BR /&gt;
2 Steve   Old&lt;BR /&gt;
6 Steve   Old&lt;BR /&gt;
7 Lisa    New&lt;BR /&gt;
3 Mike    New&lt;BR /&gt;
5 Mike    New&lt;BR /&gt;
8 Lisa    New&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=b;&lt;BR /&gt;
  by name age;&lt;BR /&gt;
run;&lt;BR /&gt;
data r;&lt;BR /&gt;
  retain t;&lt;BR /&gt;
  set b;&lt;BR /&gt;
	if first.name then t=age;&lt;BR /&gt;
  if last.name and t=age then output;&lt;BR /&gt;
  by name;&lt;BR /&gt;
	drop t;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 25 Oct 2010 20:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Comparing-rows-by-variable-HELP/m-p/73412#M1675</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-10-25T20:52:10Z</dc:date>
    </item>
  </channel>
</rss>

