<?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: find max date out of 100+ date variables with no standard name convention in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775907#M246666</link>
    <description>Are all the date variables side by side in the table?&lt;BR /&gt;If so you can reference them all at once by listing the first and last variable only:&lt;BR /&gt;&lt;BR /&gt;max (of firstVar--lastVar);&lt;BR /&gt;&lt;BR /&gt;If not, are they all SAS dates or do they all have the "DT" in the variable name? You can use a SQL step to query the SASHELP.VCOLUMNS table to create the list dynamically.</description>
    <pubDate>Fri, 22 Oct 2021 16:05:43 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-10-22T16:05:43Z</dc:date>
    <item>
      <title>find max date out of 100+ date variables with no standard name convention</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775903#M246665</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with 100+ date vairables and each observation may have 1 to 5 or so of those dates populated (all numeric date formats).&amp;nbsp; I need a way to select the max date from each observation...where the dates have no standard naming convention (all random names).&amp;nbsp; Can I do this with an array- or any other suggestion?&amp;nbsp; THis was my attempt...but clearly not working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data all1;&lt;BR /&gt;set all; &lt;BR /&gt;array dt (*) _numeric_;&lt;BR /&gt;do i= 1 to dim(dt);&lt;BR /&gt;date1 =max(dt(i)); &lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a snapshot of the data...by keep in mind there are 100+ off these dates with all different names&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jenim514_1-1634918527061.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64957i036FE04AB7E3B246/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jenim514_1-1634918527061.png" alt="jenim514_1-1634918527061.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thak you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 16:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775903#M246665</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2021-10-22T16:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: find max date out of 100+ date variables with no standard name convention</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775907#M246666</link>
      <description>Are all the date variables side by side in the table?&lt;BR /&gt;If so you can reference them all at once by listing the first and last variable only:&lt;BR /&gt;&lt;BR /&gt;max (of firstVar--lastVar);&lt;BR /&gt;&lt;BR /&gt;If not, are they all SAS dates or do they all have the "DT" in the variable name? You can use a SQL step to query the SASHELP.VCOLUMNS table to create the list dynamically.</description>
      <pubDate>Fri, 22 Oct 2021 16:05:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775907#M246666</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-22T16:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: find max date out of 100+ date variables with no standard name convention</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775914#M246667</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; yes they were side by side!  Thank for the simple solution!!</description>
      <pubDate>Fri, 22 Oct 2021 16:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-max-date-out-of-100-date-variables-with-no-standard-name/m-p/775914#M246667</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2021-10-22T16:12:38Z</dc:date>
    </item>
  </channel>
</rss>

