<?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 Race Id in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210618#M52087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 526px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="38" width="94"&gt;patient&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race1&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race2&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race3&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race4&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race5&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;PrimaryRace&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="38" style="border-color: currentColor black black;" width="94"&gt;2005blwek&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;asian&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;Sorry- starting new thread but want to reference the discussion with Race Loop(below).&amp;nbsp;&amp;nbsp; I was searching this website in hopes there was an answer already to my question.&amp;nbsp; Ok---Trying to assign PrimaryRace based on race1-race5.&amp;nbsp; My struggle involves data in the last two rows.&amp;nbsp; I need the Primary Race to be Filipino if anything in columns Race1-Race5 includes Asian. To add complexity- the Primary Race needs to be Mixed if one of the race is Filipino and anything else in Race1-Race5 is non-Asian.&amp;nbsp;&amp;nbsp; Appreciate the help!&lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-color: currentColor black black;" width="94"&gt;2012rhiol&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;b&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;mixed&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-color: currentColor black black;" width="94"&gt;1989lliok&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;b&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;mixed&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-color: currentColor black black;" width="94"&gt;2000ijlli&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;white&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" width="94"&gt;abcdef&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;f&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;filipino&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" width="94"&gt;abcdefg&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;a &lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;f&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;mixed&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2015 23:15:43 GMT</pubDate>
    <dc:creator>SannaSanna</dc:creator>
    <dc:date>2015-05-06T23:15:43Z</dc:date>
    <item>
      <title>Race Id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210618#M52087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 526px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="38" width="94"&gt;patient&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race1&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race2&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race3&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race4&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;race5&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor;" width="72"&gt;PrimaryRace&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="38" style="border-color: currentColor black black;" width="94"&gt;2005blwek&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;asian&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;Sorry- starting new thread but want to reference the discussion with Race Loop(below).&amp;nbsp;&amp;nbsp; I was searching this website in hopes there was an answer already to my question.&amp;nbsp; Ok---Trying to assign PrimaryRace based on race1-race5.&amp;nbsp; My struggle involves data in the last two rows.&amp;nbsp; I need the Primary Race to be Filipino if anything in columns Race1-Race5 includes Asian. To add complexity- the Primary Race needs to be Mixed if one of the race is Filipino and anything else in Race1-Race5 is non-Asian.&amp;nbsp;&amp;nbsp; Appreciate the help!&lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-color: currentColor black black;" width="94"&gt;2012rhiol&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;b&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;mixed&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-color: currentColor black black;" width="94"&gt;1989lliok&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;b&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;mixed&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" style="border-color: currentColor black black;" width="94"&gt;2000ijlli&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" style="border-color: currentColor black black currentColor;" width="72"&gt;white&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" width="94"&gt;abcdef&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;a&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;f&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;filipino&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD class="xl65" height="19" width="94"&gt;abcdefg&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;a &lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;f&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;w&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;missing&lt;/TD&gt;&lt;TD class="xl65" width="72"&gt;mixed&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 23:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210618#M52087</guid>
      <dc:creator>SannaSanna</dc:creator>
      <dc:date>2015-05-06T23:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Race Id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210619#M52088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If &lt;EM&gt;races&lt;/EM&gt; are really coded with single letters, you could do :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length patient $10 race1-race5 $1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input patient race1-race5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2005blwek missing a a a a&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2012rhiol a missing b missing a&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1989lliok missing b missing missing w&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2000ijlli w w w w w&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;abcdef a f missing missing missing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;abcdefg a f w missing missing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc transpose data=have out=temp(where=(col1 ne "m")) name=race;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;by patient notsorted;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var race:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=temp nodupkey; by patient col1; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data pr;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length r $8 pr $1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do until(last.patient);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set temp; by patient;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = cats(r, col1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when(length(r) &amp;lt; 2) pr = r;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when(r = "af") pr = "f";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise pr = "x"; /* x stands for mixed */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep patient pr;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=pr noobs; var patient pr; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 04:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210619#M52088</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-05-07T04:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Race Id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210620#M52089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;is non-Asian ? Can you enumerate&amp;nbsp; it ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
length patient $10 race1-race5 $1;
input patient race1-race5;
datalines;
2005blwek . a a a a
2012rhiol a . b . a
1989lliok . b . . w
2000ijlli w w w w w
abcdef a f . . .
abcdefg a f w . .
;
run;
data want;
 set have;
 array x{*} $ race:;
 a=0;b=0;w=0;f=0;
 if 'a' in x then a=1;
 if 'b' in x then b=1;
 if 'w' in x then w=1;
 if 'f' in x then f=1;
length PrimaryRace $ 10;
select;
when(a=1 and b=0 and w=0 and f=0) PrimaryRace='asian';
when(a=0 and b=1 and w=0 and f=0) PrimaryRace='b';
when(a=0 and b=0 and w=1 and f=0) PrimaryRace='white';
when(a=0 and b=0 and w=0 and f=1) PrimaryRace='filipino';
when(a=1 and b=0 and w=0 and f=1) PrimaryRace='filipino';
otherwise PrimaryRace='mixed';
end;
drop a b w f;
run;





&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 12:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210620#M52089</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-07T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Race Id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210621#M52090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simpler the better. I think this is simpler...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length patient $10 race1-race5 $1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input patient race1-race5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2005blwek missing a a a a&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2012rhiol a missing b missing a&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1989lliok missing b missing missing w&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2000ijlli w w w w w&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;abcdef a f missing missing missing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;abcdefg a f w missing missing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array r{*} race:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length pr $1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pr = r{1};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do i = 2 to dim(r);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if pr ne "x" and r{i} ne "m" then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if pr = "m" then pr = r{i};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if pr = "a" and r{i} = "f" then pr = "f";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if pr = "f" and r{i} = "a" then;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if pr ne r{i} then pr = "x";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop i;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=want noobs; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 02:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210621#M52090</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-05-08T02:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Race Id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210622#M52091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works perfectly!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ohh Thank you Thank you Thank you!!! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 15:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Race-Id/m-p/210622#M52091</guid>
      <dc:creator>SannaSanna</dc:creator>
      <dc:date>2015-05-08T15:10:25Z</dc:date>
    </item>
  </channel>
</rss>

