<?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: How do I automate dates in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806241#M33545</link>
    <description>Thank you so much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;, your solution worked!&lt;BR /&gt;&lt;BR /&gt;Thank you so much!</description>
    <pubDate>Wed, 06 Apr 2022 10:19:56 GMT</pubDate>
    <dc:creator>MagD</dc:creator>
    <dc:date>2022-04-06T10:19:56Z</dc:date>
    <item>
      <title>How do I automate dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806225#M33541</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me with automating dates in my code. I currently have the following code which I have to change every month:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;/*need to update at the beginning of the month*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;%let nin_TM = 01MAR2022;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;%let nin_LM = 01FEB2022;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;%let nin_LY = 01MAR2021;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;Please help me with automating the dates in the above so that I don't need to manually change the dates every month.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 09:15:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806225#M33541</guid>
      <dc:creator>MagD</dc:creator>
      <dc:date>2022-04-06T09:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automate dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806233#M33544</link>
      <description>&lt;P&gt;Maxim 28: Macro Variables Need No Formats.&lt;/P&gt;
&lt;P&gt;By using raw values, you can use your dates without having to add quotes and the trailing d everywhere you put them in code.&lt;/P&gt;
&lt;P&gt;(Exception: when macro variables are used in human-readable output, like titles etc).&lt;/P&gt;
&lt;P&gt;So see this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let nin_TM = %sysfunc(intnx(month,%sysfunc(today()),0,b));
%let nin_LM = %sysfunc(intnx(month,&amp;amp;nin_tm.,-1,b));
%let nin_LY = %sysfunc(intnx(year,&amp;amp;nin_tm.,-1,s));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can display the formatted values (for control) like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
nin_tm = &amp;amp;nin_tm.;
nin_lm = &amp;amp;nin_lm.;
nin_ly = &amp;amp;nin_ly.;
format nin: date9.;
put nin_tm= nin_lm= nin_ly=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2022 09:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806233#M33544</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-06T09:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I automate dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806241#M33545</link>
      <description>Thank you so much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;, your solution worked!&lt;BR /&gt;&lt;BR /&gt;Thank you so much!</description>
      <pubDate>Wed, 06 Apr 2022 10:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-automate-dates/m-p/806241#M33545</guid>
      <dc:creator>MagD</dc:creator>
      <dc:date>2022-04-06T10:19:56Z</dc:date>
    </item>
  </channel>
</rss>

