<?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: create race Variable  for MULTIPUL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628248#M185599</link>
    <description>&lt;P&gt;Native and American as separate&amp;nbsp;races????&lt;/P&gt;
&lt;P&gt;Native what? Is this the Native Hawaiian/ Other Pacific Islander or Alaska Native/American Indian (two typical race categories in the US OMB playbook)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 15:47:31 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-02-28T15:47:31Z</dc:date>
    <item>
      <title>create race Variable  for MULTIPUL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628126#M185546</link>
      <description>&lt;P&gt;have data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input id white$&amp;nbsp; black$ Native$&amp;nbsp; American$&amp;nbsp; Asian $;&lt;BR /&gt;datalines;&lt;BR /&gt;101 1 . . . .&lt;BR /&gt;102 1 1 . . .&lt;BR /&gt;103 1 1 1 1 .&lt;BR /&gt;104 1 . . . .&lt;BR /&gt;105 . . . . 1&lt;BR /&gt;106 . . 1 1 .&lt;BR /&gt;107 . 1 . . .&lt;BR /&gt;108 . . 1 . .&lt;BR /&gt;109 . . . 1 .&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i want data this type of data how to do program ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data aa;&lt;BR /&gt;length race $20;&lt;BR /&gt;input id white$&amp;nbsp; black$ Native$&amp;nbsp; American$&amp;nbsp; Asian $ race $;&lt;BR /&gt;datalines;&lt;BR /&gt;101 1 . . . . WHITE&lt;BR /&gt;102 1 1 . . . MULTIPUL&lt;BR /&gt;103 1 1 1 1 . MULTIPUL&lt;BR /&gt;104 1 . . . . WHITE&lt;BR /&gt;105 . . . . 1 ASIAN&lt;BR /&gt;106 . . 1 1 . MULTIPUL&lt;BR /&gt;107 . 1 . . . BLACK&lt;BR /&gt;108 . . 1 . . NATIVE&lt;BR /&gt;109 . . . 1 . AMERICAN&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 08:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628126#M185546</guid>
      <dc:creator>teja5959</dc:creator>
      <dc:date>2020-02-28T08:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: create race Variable  for MULTIPUL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628132#M185551</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input id white black Native American Asian;
datalines;
101 1 . . . .
102 1 1 . . .
103 1 1 1 1 .
104 1 . . . .
105 . . . . 1
106 . . 1 1 .
107 . 1 . . .
108 . . 1 . .
109 . . . 1 .
run;

data aa;
    set a;
    array arr {*} white--Asian;
    if n(of arr[*]) &amp;gt; 1 then race='Multiple';
    else race = vname(arr[whichn(1, of arr[*])]);                 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 07:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628132#M185551</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-28T07:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: create race Variable  for MULTIPUL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628138#M185552</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127990"&gt;@teja5959&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use an ARRAY to do this, and the VNAME() function to retrieve the column name when the value is 1:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set a;
	length race $ 20;
	array _race (*) white black Native American Asian;
	do i=1 to dim(_race);
		if sum(of _race(*)) = 1 then do;
			if _race(i)=1 then race = upcase(vname(_race(i)));
		end;
		if sum(of _race(*)) &amp;gt; 1 then race = "MULTIPUL";
	end;
	drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 08:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628138#M185552</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-28T08:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: create race Variable  for MULTIPUL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628248#M185599</link>
      <description>&lt;P&gt;Native and American as separate&amp;nbsp;races????&lt;/P&gt;
&lt;P&gt;Native what? Is this the Native Hawaiian/ Other Pacific Islander or Alaska Native/American Indian (two typical race categories in the US OMB playbook)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 15:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-race-Variable-for-MULTIPUL/m-p/628248#M185599</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-28T15:47:31Z</dc:date>
    </item>
  </channel>
</rss>

