<?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: Using an array to output a column title containing a max value found using Max ( ); in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-array-to-output-a-column-title-containing-a-max-value/m-p/498148#M72502</link>
    <description>You don't need VNAME, you can use WHICHN since your array is indexed from 0 to 4 in logical order. Then you can use the index-1 to indicate the stage. &lt;BR /&gt;You could also index the array using 0:4 instead of 1:5, &lt;BR /&gt;&lt;BR /&gt;array s(0:4) stage0-stage4;</description>
    <pubDate>Sun, 23 Sep 2018 02:00:55 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-09-23T02:00:55Z</dc:date>
    <item>
      <title>Using an array to output a column title containing a max value found using Max ( );</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-array-to-output-a-column-title-containing-a-max-value/m-p/498136#M72501</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The goal is to create a new column called&amp;nbsp;&lt;I&gt;typical. &lt;/I&gt;The new variable is to hold the max value&lt;I&gt;&amp;nbsp;&lt;/I&gt;among columns stages 0 through 4. I am also looking to create a variable called theMax&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;that outputs the column title that includes the max value found across the five stage count variables.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Data typical2000_1;&lt;BR /&gt;Set typical2000;&lt;BR /&gt;theMax = max(stage_0, stage_i, stage_ii, stage_iii, stage_iv);&lt;BR /&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data typical2 (keep = primsite stage_0 stage_i stage_ii stage_iii stage_iv themax);&lt;BR /&gt;set typical2000_1;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data typical3;&lt;BR /&gt;set typical2;&lt;BR /&gt;rename stage_0 = stage0;&lt;BR /&gt;rename stage_i = stage1;&lt;BR /&gt;rename stage_ii = stage2;&lt;BR /&gt;rename stage_iii = stage3;&lt;BR /&gt;rename stage_iv = stage4;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set typical3;&lt;BR /&gt;array s stage0 stage1 stage2 stage3 stage4;&lt;BR /&gt;maxvalue=max(of s(*));&lt;BR /&gt;maxvar=vname(s(whichn(maxvalue, of s(*))));&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Sep 2018 00:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-an-array-to-output-a-column-title-containing-a-max-value/m-p/498136#M72501</guid>
      <dc:creator>scooterpies</dc:creator>
      <dc:date>2018-09-23T00:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using an array to output a column title containing a max value found using Max ( );</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-array-to-output-a-column-title-containing-a-max-value/m-p/498148#M72502</link>
      <description>You don't need VNAME, you can use WHICHN since your array is indexed from 0 to 4 in logical order. Then you can use the index-1 to indicate the stage. &lt;BR /&gt;You could also index the array using 0:4 instead of 1:5, &lt;BR /&gt;&lt;BR /&gt;array s(0:4) stage0-stage4;</description>
      <pubDate>Sun, 23 Sep 2018 02:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-an-array-to-output-a-column-title-containing-a-max-value/m-p/498148#M72502</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-23T02:00:55Z</dc:date>
    </item>
  </channel>
</rss>

