<?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 How do I identify a fieldname from its value? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22543#M4945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; What happens if you have multiples? Which variable would you take? or would you take 3 of the same? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use an array of sorts with the whichn and vname function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.pricedata;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; pr{*} price1--price17;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;firstvar=vname(pr[whichn(largest(&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, of pr{*}), of pr{*})]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2011 21:15:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2011-06-28T21:15:15Z</dc:date>
    <item>
      <title>How do I identify a fieldname from its value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22542#M4944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys, I am unsure how to proceed at this point.&amp;nbsp; So I have thousands of rows of data with a hundred different fields.&amp;nbsp; The field values are all integer values.&amp;nbsp; I would like to identify which field contains the highest value in each row.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use the LARGEST() function to identify the 3 highest values in each row, but what I really need is the names of those 3 fields (added as 3 extra fields).&amp;nbsp; Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 20:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22542#M4944</guid>
      <dc:creator>ritam2011</dc:creator>
      <dc:date>2011-06-28T20:21:19Z</dc:date>
    </item>
    <item>
      <title>How do I identify a fieldname from its value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22543#M4945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; What happens if you have multiples? Which variable would you take? or would you take 3 of the same? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use an array of sorts with the whichn and vname function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.pricedata;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; pr{*} price1--price17;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;firstvar=vname(pr[whichn(largest(&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, of pr{*}), of pr{*})]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 21:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22543#M4945</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-06-28T21:15:15Z</dc:date>
    </item>
    <item>
      <title>How do I identify a fieldname from its value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22544#M4946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza -- VNAME was what I was looking for.&amp;nbsp; So I have the above working, the issue now is that some of the rows have all zero values in the fields, and the output in these cases is the first fieldname repeated all 3 times.&amp;nbsp; I would like simply not to display any fieldname if values are 0.&amp;nbsp; But how to do this with the above code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 16:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22544#M4946</guid>
      <dc:creator>ritam2011</dc:creator>
      <dc:date>2011-06-30T16:06:41Z</dc:date>
    </item>
    <item>
      <title>How do I identify a fieldname from its value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22545#M4947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then using array will give you more control.&lt;/P&gt;&lt;P&gt;Since not seeing your data ,it is hard to code exactly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 05:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-identify-a-fieldname-from-its-value/m-p/22545#M4947</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-07-01T05:00:43Z</dc:date>
    </item>
  </channel>
</rss>

