<?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 to get the name of the variable with the max value? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133859#M27194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my dataset, i have incm1, incm2, incm3 and incm4 for each customer. some have only 1 income, some have 2 or more. i want to create a new variable with the max value of the 4 incomes and at the same time, i need to create a flag indicating which income is the max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example, the max income of a record is the incm1, the new income value is easy, it's just new_income=max(incm1,incm2,incm3,incm4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know using if statement and matching the new income value and the 4 income values can show me the source of the income.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if new_income=incm1 then flag='incm1'; else if new_income=incm2 then flag='incm2'; etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but are there any other ways to create the new income flag which shows 'incm1' for this record? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 May 2013 15:23:25 GMT</pubDate>
    <dc:creator>Edmond</dc:creator>
    <dc:date>2013-05-12T15:23:25Z</dc:date>
    <item>
      <title>how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133859#M27194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my dataset, i have incm1, incm2, incm3 and incm4 for each customer. some have only 1 income, some have 2 or more. i want to create a new variable with the max value of the 4 incomes and at the same time, i need to create a flag indicating which income is the max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example, the max income of a record is the incm1, the new income value is easy, it's just new_income=max(incm1,incm2,incm3,incm4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know using if statement and matching the new income value and the 4 income values can show me the source of the income.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if new_income=incm1 then flag='incm1'; else if new_income=incm2 then flag='incm2'; etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but are there any other ways to create the new income flag which shows 'incm1' for this record? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 May 2013 15:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133859#M27194</guid>
      <dc:creator>Edmond</dc:creator>
      <dc:date>2013-05-12T15:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133860#M27195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use an array and function vname as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;input incm1 incm2 incm3 incm4;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;1 2 3 4 &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;array inc{*} incm:;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;incMax = max(of inc{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;do _n_ = 1 to dim(inc);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if inc{_n_} = incMax then incId = vname(inc{_n_});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;proc print; run;&lt;/STRONG&gt;&lt;/SPAN&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>Sun, 12 May 2013 17:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133860#M27195</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-12T17:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133861#M27196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this one is great. thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 01:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133861#M27196</guid>
      <dc:creator>Edmond</dc:creator>
      <dc:date>2013-05-13T01:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133862#M27197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PG,&lt;/P&gt;&lt;P&gt;You also can use whichn() to instead of DO LOOP . make it more succinct .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 13:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133862#M27197</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-13T13:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133863#M27198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; . I had forgotten about whichn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 14:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133863#M27198</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-13T14:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133864#M27199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you please explain :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;do _n_ = 1 to dim(inc);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Generally _n_ is from top to bottom. Here we are saying to do it across(column wise)????&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Also in the below log why is it performing four times???it should be in a single step???&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;52&amp;nbsp;&amp;nbsp; data want;&lt;BR /&gt;53&amp;nbsp;&amp;nbsp; set have;&lt;BR /&gt;54&amp;nbsp;&amp;nbsp; array inc{*} incm:;&lt;BR /&gt;55&amp;nbsp;&amp;nbsp; incMax = max(of inc{*});&lt;BR /&gt;56&amp;nbsp;&amp;nbsp; do _n_ = 1 to dim(inc);&lt;BR /&gt;57&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if inc{_n_} = incMax then incId = vname(inc{_n_});&lt;BR /&gt;58&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; putlog _all_;&lt;/STRONG&gt;&lt;BR /&gt;59&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;60&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;incm1=1 incm2=2 incm3=3 incm4=4 incMax=4 incId=&amp;nbsp; _ERROR_=0 _N_=1&lt;BR /&gt;incm1=1 incm2=2 incm3=3 incm4=4 incMax=4 incId=&amp;nbsp; _ERROR_=0 _N_=2&lt;BR /&gt;incm1=1 incm2=2 incm3=3 incm4=4 incMax=4 incId=&amp;nbsp; _ERROR_=0 _N_=3&lt;BR /&gt;incm1=1 incm2=2 incm3=3 incm4=4 incMax=4 incId=incm4 _ERROR_=0 _N_=4&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 20:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133864#M27199</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-05-15T20:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133865#M27200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable&lt;STRONG&gt; _n_&lt;/STRONG&gt; is always created by SAS within a datastep. Normally &lt;STRONG&gt;_n_&lt;/STRONG&gt; counts the number of iterations of the datastep and is not saved in the resulting dataset. When you don't need its value, you can do anything you want with &lt;STRONG&gt;_n_&lt;/STRONG&gt;. In my little program I used it as the control variable for my DO loop. That cheap trick saves me the trouble of dropping the variable (since it is not saved).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array &lt;STRONG&gt;inc&lt;/STRONG&gt; contains all variables beginning with incm (&lt;STRONG&gt;incm1, incm2, incm3, incm4&lt;/STRONG&gt;). The DO loop scans the elements of array &lt;STRONG&gt;inc&lt;/STRONG&gt; to find which one has the maximum value. It has to loop &lt;STRONG&gt;dim(inc) = 4&lt;/STRONG&gt; times. Each time it loops, &lt;STRONG&gt;printlog&lt;/STRONG&gt; executes. Thus it prints four lines on the log. You can see that it finds the maximum value on the last iteration. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&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, 16 May 2013 00:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133865#M27200</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-16T00:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133866#M27201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, like &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; pointed out, you could also use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want2;&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 inc{*} incm:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;incId = vname(inc{whichn(max(of inc{*}),of inc{*})});&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;to avoid programming the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quiz &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;1) The two codes do not always give the same result for &lt;STRONG&gt;incId&lt;/STRONG&gt;. Can you tell how?&lt;/P&gt;&lt;P&gt;2) Can you modify the looping code so that both codes will give the same result?&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, 16 May 2013 02:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133866#M27201</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-16T02:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133867#M27202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;hope you are doing good.&lt;/P&gt;&lt;P&gt;i still have question understanding this concept..&lt;/P&gt;&lt;P&gt;I expect x0 to have a value of 5!!!!!!!becos&lt;STRONG&gt; .&lt;/STRONG&gt;&amp;nbsp; occupies the 5th position????????&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;why is x0 in the below example having a value of missing???&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array dates&lt;LI&gt; Columbus Hastings Nicea US_Independence missing&lt;/LI&gt;&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp; Magna_Carta Gutenberg&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp; (1492 1066 325 1776 . 1215 1450);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x0=whichn(., of dates&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x1=whichn(1492, of dates&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x2=whichn(1066, of dates&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x3=whichn(1450, of dates&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x4=whichn(1000, of dates&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put x0= / x1= / x2= / x3= / x4=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;SAS writes the following output to the log:&lt;/P&gt;&lt;P&gt;x0=.&lt;/P&gt;&lt;P&gt;x1=1&lt;/P&gt;&lt;P&gt;x2=2&lt;/P&gt;&lt;P&gt;x3=7&lt;/P&gt;&lt;P&gt;x4=0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 08:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133867#M27202</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-05-16T08:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133868#M27203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like whichn() will ignore missing value, like sum() , mean() &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 10:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133868#M27203</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-16T10:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133869#M27204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing it can happen when two or more columns share the max value? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 15:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133869#M27204</guid>
      <dc:creator>aland1</dc:creator>
      <dc:date>2013-05-16T15:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133870#M27205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good guess! What happens then?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 16:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133870#M27205</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-16T16:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133871#M27206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the variable name of last iteration with maximum value is outputted??? If it is right then how do we correct this while using whichn?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 21:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133871#M27206</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-05-16T21:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133872#M27207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right! The looping code will return the last maximum whereas whichn will return the first one. I would find it easier to modify the looping algorithm to match the whichn algorithm than the other way around.I can think of two simple ways to get the looping code to return the first max. I will post them over the weekend &lt;STRONG&gt;if you don't find them first&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, 17 May 2013 01:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133872#M27207</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-17T01:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the name of the variable with the max value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133873#M27208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi PG,&lt;/P&gt;&lt;P&gt;I could not think of a proper solution for the loop to return the max value...&lt;/P&gt;&lt;P&gt;Could you help me with that/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 May 2013 16:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-the-name-of-the-variable-with-the-max-value/m-p/133873#M27208</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-05-18T16:05:23Z</dc:date>
    </item>
  </channel>
</rss>

