<?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: Proc export timestamp with MAX date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775960#M39792</link>
    <description>&lt;P&gt;And while you're at it, change the format to YYMMN6. or YYMMD7., which sorts in chronological order and makes handling the files&amp;nbsp;&lt;STRONG&gt;much&lt;/STRONG&gt; easier.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Oct 2021 19:39:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-10-22T19:39:56Z</dc:date>
    <item>
      <title>Proc export timestamp with MAX date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775943#M39789</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've been using the following Proc export statement for one of my projects to get the desired ts and it works great.&amp;nbsp; However my data only contained one month of data so my ORDER_Date always gave me the appropriate timestamp that I wanted.&lt;/P&gt;
&lt;P&gt;Now, I'm pulling multiple months so I have more than one ORDER_Date.&amp;nbsp; I would like the ts to be the MAX ORDER_Date but I can't seem to get it to work.&amp;nbsp; Any direction would be appreciated!&amp;nbsp; thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Currently:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRogers_0-1634927021546.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64963iE61394930F2BCCBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRogers_0-1634927021546.png" alt="LRogers_0-1634927021546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried:&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;set work.XACTLY (obs=1);&lt;BR /&gt;call symput('ts', put(MAX(ORDER_Date), MONYY7.));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;but that didn't work.&amp;nbsp; I also tried creating a new field to reference but that didn't work either.&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;set work.XACTLY (obs=1);&lt;/P&gt;
&lt;P&gt;last_date =&amp;nbsp;MAX(ORDER_Date);&lt;BR /&gt;call symput('ts', put(last_date, MONYY7.));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 18:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775943#M39789</guid>
      <dc:creator>LRogers</dc:creator>
      <dc:date>2021-10-22T18:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export timestamp with MAX date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775955#M39791</link>
      <description>&lt;P&gt;Change how you're creating the macro varaible from data step to SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select put(max(order_date), monyy7.) into :ts TRIMMED
from xactly;
quit;

*check macro variable creation;
%put &amp;amp;ts.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281120"&gt;@LRogers&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've been using the following Proc export statement for one of my projects to get the desired ts and it works great.&amp;nbsp; However my data only contained one month of data so my ORDER_Date always gave me the appropriate timestamp that I wanted.&lt;/P&gt;
&lt;P&gt;Now, I'm pulling multiple months so I have more than one ORDER_Date.&amp;nbsp; I would like the ts to be the MAX ORDER_Date but I can't seem to get it to work.&amp;nbsp; Any direction would be appreciated!&amp;nbsp; thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Currently:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRogers_0-1634927021546.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64963iE61394930F2BCCBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRogers_0-1634927021546.png" alt="LRogers_0-1634927021546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried:&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;set work.XACTLY (obs=1);&lt;BR /&gt;call symput('ts', put(MAX(ORDER_Date), MONYY7.));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;but that didn't work.&amp;nbsp; I also tried creating a new field to reference but that didn't work either.&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;set work.XACTLY (obs=1);&lt;/P&gt;
&lt;P&gt;last_date =&amp;nbsp;MAX(ORDER_Date);&lt;BR /&gt;call symput('ts', put(last_date, MONYY7.));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 19:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775955#M39791</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-22T19:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export timestamp with MAX date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775960#M39792</link>
      <description>&lt;P&gt;And while you're at it, change the format to YYMMN6. or YYMMD7., which sorts in chronological order and makes handling the files&amp;nbsp;&lt;STRONG&gt;much&lt;/STRONG&gt; easier.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 19:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775960#M39792</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-22T19:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export timestamp with MAX date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775984#M39793</link>
      <description>Thank you very much!  I definitely wouldn't have been able to come up with this myself nor do i quite understand it...but it worked!  haha!  Thank you!  Much appreciated!</description>
      <pubDate>Fri, 22 Oct 2021 22:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-export-timestamp-with-MAX-date/m-p/775984#M39793</guid>
      <dc:creator>LRogers</dc:creator>
      <dc:date>2021-10-22T22:15:35Z</dc:date>
    </item>
  </channel>
</rss>

