<?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 Need to get column name in other dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-column-name-in-other-dataset/m-p/680954#M205923</link>
    <description>Hell all , I'm looking to get the column headers name in other dataset based on the flag . Please see the attached pdf for the requirements.&lt;BR /&gt;Do we have any options to create it please let me know thanks in advance.</description>
    <pubDate>Wed, 02 Sep 2020 12:50:41 GMT</pubDate>
    <dc:creator>shiv999</dc:creator>
    <dc:date>2020-09-02T12:50:41Z</dc:date>
    <item>
      <title>Need to get column name in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-column-name-in-other-dataset/m-p/680954#M205923</link>
      <description>Hell all , I'm looking to get the column headers name in other dataset based on the flag . Please see the attached pdf for the requirements.&lt;BR /&gt;Do we have any options to create it please let me know thanks in advance.</description>
      <pubDate>Wed, 02 Sep 2020 12:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-get-column-name-in-other-dataset/m-p/680954#M205923</guid>
      <dc:creator>shiv999</dc:creator>
      <dc:date>2020-09-02T12:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get column name in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-column-name-in-other-dataset/m-p/680962#M205926</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $ id (Location_1-Location_3)(:$1.);
datalines;
STEF  1001 Y N N
JACK  1002 N N Y
MADDY 1003 Y N N
JEFFY 1004 N N Y
BEN   1005 N N Y
LAMAR 1006 Y N N
;

data want(drop=name location_:);
   set have;
   array l {*} Location_1-Location_3;
   location = vname(l[whichc('Y', of l[*])]);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;id    location 
1001  Location_1 
1002  Location_3 
1003  Location_1 
1004  Location_3 
1005  Location_3 
1006  Location_1 &lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Sep 2020 12:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-get-column-name-in-other-dataset/m-p/680962#M205926</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-09-02T12:58:37Z</dc:date>
    </item>
  </channel>
</rss>

