<?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: SAS EG 5.1 - Adding date to the end of an XLSX export in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258250#M18080</link>
    <description>&lt;P&gt;Freelance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much, that explained a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2016 16:11:13 GMT</pubDate>
    <dc:creator>EIrvin</dc:creator>
    <dc:date>2016-03-22T16:11:13Z</dc:date>
    <item>
      <title>SAS EG 5.1 - Adding date to the end of an XLSX export</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258196#M18075</link>
      <description>&lt;P&gt;I am extremely new to SAS, and know nothing of coding!! I am attempting to add a date, in MMMYYYY format,&amp;nbsp;to my exported filename based on the previous month.&amp;nbsp; For example, If I am reporiting data as of the end of February, and it is currently March. What would I need to write in my %let statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;P&gt;%let reptgmo = %sysfunc(today()-31,AFRDFMYw.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It says I am missing a parenthesis after macro function, but as far as I can see, I have matching parens.&amp;nbsp; Is there a better way to do this for set it and forget it reporting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 13:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258196#M18075</guid>
      <dc:creator>EIrvin</dc:creator>
      <dc:date>2016-03-22T13:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG 5.1 - Adding date to the end of an XLSX export</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258212#M18076</link>
      <description>&lt;P&gt;Macro (%let in your case) is a text focused language. You can force&amp;nbsp;calculation by using %eval(). But it quickly becomes quite unreadable. So sometimes it's easier to do you calculation&amp;nbsp;in a data _null_; step, and then do a call symput() to generate your macro variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you are new to SA coding, perhaps you should&amp;nbsp;try to use a Prompt instead, which in turn will generate the macro variable for you.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 14:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258212#M18076</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-22T14:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG 5.1 - Adding date to the end of an XLSX export</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258247#M18079</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78332"&gt;@EIrvin﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a corrected version of your %LET statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let reptgmo=%sysfunc(intnx(month,%sysfunc(today()),-1),AFRDFMY7.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;%SYSFUNC must be applied to each data step function used in the %LET statement. So, the missing parenthesis in your case was the one right&amp;nbsp;after "today()". This in turn, however, would have required another function, e.g., the PUTN function (and hence another %SYSFUNC call), to apply the format to the calculated date value.&lt;/LI&gt;
&lt;LI&gt;Instead of subtracting 31 days from&amp;nbsp;today's date it's safer to use the &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl//en/lefunctionsref/67960/HTML/default/p10v3sa3i4kfxfn1sovhi5xzxh8n.htm" target="_blank"&gt;INTNX function&lt;/A&gt; to correctly&amp;nbsp;go back&amp;nbsp;to the previous month. Please note that otherwise, if the code was executed on 1st March, you would jump into&amp;nbsp;January!&lt;/LI&gt;
&lt;LI&gt;The &lt;STRONG&gt;&lt;EM&gt;w&lt;/EM&gt;&lt;/STRONG&gt;. in your format specification has to be replaced by the &lt;STRONG&gt;w&lt;/STRONG&gt;idth of the formatted value, i.e. 7 for MMMYYYY.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 16:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258247#M18079</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-22T16:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG 5.1 - Adding date to the end of an XLSX export</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258250#M18080</link>
      <description>&lt;P&gt;Freelance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much, that explained a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 16:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-5-1-Adding-date-to-the-end-of-an-XLSX-export/m-p/258250#M18080</guid>
      <dc:creator>EIrvin</dc:creator>
      <dc:date>2016-03-22T16:11:13Z</dc:date>
    </item>
  </channel>
</rss>

