<?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: return the max value  if the dates are progressing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837132#M331002</link>
    <description>yes the date are all consecutive</description>
    <pubDate>Thu, 06 Oct 2022 08:29:29 GMT</pubDate>
    <dc:creator>u57961979</dc:creator>
    <dc:date>2022-10-06T08:29:29Z</dc:date>
    <item>
      <title>return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837123#M331000</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 558px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75952iC2968DAEE7203497/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;Hello, I need your help.&lt;BR /&gt;I have to find all the values that have a total over 1 million, but if the dates are progressive, and there are, for example, 3 consecutive dates with a value over 1 million, I have to select only the date with the highest total.&lt;BR /&gt;in the attached example, it should output as output:&lt;BR /&gt;dates: 02/01/2000 and 06/01/2000&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 08:19:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837123#M331000</guid>
      <dc:creator>u57961979</dc:creator>
      <dc:date>2022-10-06T08:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837131#M331001</link>
      <description>&lt;P&gt;Are the dates actually consecutive? Meaning, there are no gaps in the dates, correct?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 08:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837131#M331001</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-06T08:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837132#M331002</link>
      <description>yes the date are all consecutive</description>
      <pubDate>Thu, 06 Oct 2022 08:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837132#M331002</guid>
      <dc:creator>u57961979</dc:creator>
      <dc:date>2022-10-06T08:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837133#M331003</link>
      <description>&lt;P&gt;Do you have the flag variable already?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 08:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837133#M331003</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-06T08:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837134#M331004</link>
      <description>No i have only the date and the total</description>
      <pubDate>Thu, 06 Oct 2022 08:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837134#M331004</guid>
      <dc:creator>u57961979</dc:creator>
      <dc:date>2022-10-06T08:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837157#M331006</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/370838"&gt;@u57961979&lt;/a&gt;,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/370838"&gt;@u57961979&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;No i have only the date and the total&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you don't need the flag as a variable, you can create a &lt;EM&gt;format&lt;/EM&gt; that provides the same information and then use it together with the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p0yeyftk8ftuckn1o5qzy53284gz.htm#p0yh1ocgld557an11ewawcc2kop5" target="_blank" rel="noopener"&gt;GROUPFORMAT option&lt;/A&gt; of the BY statement in a DATA step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value flag
low -1e6  = '0'
1e6&amp;lt;-high = '1';
run;

data want(drop=d t m);
do until(t&amp;gt;1e6 &amp;amp; last.t);
  set have(rename=(date=d total=t));
  by t groupformat notsorted;
  format t flag.;
  if t&amp;gt;1e6 &amp;amp; t&amp;gt;m then do;
    m=t;
    date=d;
    total=t;
  end;
end;
format date ddmmyy10. total commax16.2;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 10:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837157#M331006</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-06T10:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: return the max value  if the dates are progressing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837159#M331008</link>
      <description>thank you so much</description>
      <pubDate>Thu, 06 Oct 2022 10:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/return-the-max-value-if-the-dates-are-progressing/m-p/837159#M331008</guid>
      <dc:creator>u57961979</dc:creator>
      <dc:date>2022-10-06T10:55:08Z</dc:date>
    </item>
  </channel>
</rss>

