<?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: Get day and abbreviated month of a date (e.g. 2 Nov) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777848#M247550</link>
    <description>Latest_month is a macro to get the previous month (e.g. 31OCT2021) and I am trying to get the day (31) and abbreviated month (Oct) based on this macro,.&lt;BR /&gt;</description>
    <pubDate>Tue, 02 Nov 2021 09:47:28 GMT</pubDate>
    <dc:creator>ywon111</dc:creator>
    <dc:date>2021-11-02T09:47:28Z</dc:date>
    <item>
      <title>Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777843#M247547</link>
      <description>&lt;P&gt;I have a macro to get the latest month as below and trying to use this to get day and month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let Latest_month = %sysfunc(intnx(month, %sysfunc(today()), -1, END), date9.);;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I have tried:&lt;/P&gt;
&lt;P&gt;%let day = %sysfunc(month("&amp;amp;Latest_month"d),DAYw.);&lt;BR /&gt;%let sysmonth= %sysfunc(put(month("&amp;amp;Latest_month "d),monname3.));&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 09:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777843#M247547</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2021-11-02T09:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777846#M247548</link>
      <description>&lt;P&gt;I'm not sure what your desired result is here?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 09:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777846#M247548</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-02T09:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777848#M247550</link>
      <description>Latest_month is a macro to get the previous month (e.g. 31OCT2021) and I am trying to get the day (31) and abbreviated month (Oct) based on this macro,.&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Nov 2021 09:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777848#M247550</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2021-11-02T09:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777853#M247553</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Latest_month = %sysfunc(intnx(month, %sysfunc(today()), -1, END), date9.);

%let day = %sysfunc(month("&amp;amp;Latest_month"d));
%let month = %sysfunc(putn("&amp;amp;Latest_month"d, monname3.));

%put &amp;amp;day.;
%put &amp;amp;month.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Nov 2021 09:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777853#M247553</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-02T09:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777866#M247556</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/323303"&gt;@ywon111&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this. The main difference is that day and not month is assigned to the &amp;amp;day macro variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(propcase(%sysfunc(putn(&amp;amp;Latest_month,date5.))));
%let day = %sysfunc(day(&amp;amp;Latest_month));
%let month = %sysfunc(putn(&amp;amp;Latest_month, monname3.));

%put &amp;amp;day.;
%put &amp;amp;month.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Nov 2021 10:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777866#M247556</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-11-02T10:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777870#M247558</link>
      <description>&lt;P&gt;Is this for display purposes?&lt;/P&gt;
&lt;P&gt;If yes, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Latest_month = %sysfunc(intnx(month,%sysfunc(today()),-1,e));
%let day = %sysfunc(putn(&amp;amp;Latest_month.,day2.));
%let sysmonth = %sysfunc(putn(&amp;amp;Latest_month.,monname3.));
%put &amp;amp;=day. &amp;amp;=sysmonth.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt; 69         %let Latest_month = %sysfunc(intnx(month,%sysfunc(today()),-1,e));
 70         %let day = %sysfunc(putn(&amp;amp;Latest_month.,day2.));
 71         %let sysmonth = %sysfunc(putn(&amp;amp;Latest_month.,monname3.));
 72         %put &amp;amp;=day. &amp;amp;=sysmonth.;
 DAY=31 SYSMONTH=Oct
&lt;/PRE&gt;
&lt;P&gt;Note that macro variables used in calculations need no formats, see Maxim 28.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 10:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777870#M247558</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-02T10:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777872#M247559</link>
      <description>Thanks, all worked great.&lt;BR /&gt;&lt;BR /&gt;Adding this into title for proc report also and looks like when export to excel then the space in between day, month and year disappeared (e.g. 31OCT2021) instead of 31 OCT 2021.&lt;BR /&gt;&lt;BR /&gt;Any trick to fix this?&lt;BR /&gt;&lt;BR /&gt;This is what I have &lt;BR /&gt;&lt;BR /&gt;Title1 j=left "Graph1 blah blah blah as at &amp;amp;day &amp;amp;month &amp;amp;year";&lt;BR /&gt;proc report data=want&lt;BR /&gt;...</description>
      <pubDate>Tue, 02 Nov 2021 10:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777872#M247559</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2021-11-02T10:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777874#M247560</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/323303"&gt;@ywon111&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you actually want 10 as day?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 10:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777874#M247560</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-11-02T10:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777884#M247568</link>
      <description>&lt;P&gt;Please post your report code, from ODS EXCEL to ODS EXCEL CLOSE.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 11:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/777884#M247568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-02T11:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get day and abbreviated month of a date (e.g. 2 Nov)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/778049#M247639</link>
      <description>&lt;P&gt;Thanks, that's exactly what I needed.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 22:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-day-and-abbreviated-month-of-a-date-e-g-2-Nov/m-p/778049#M247639</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2021-11-02T22:37:45Z</dc:date>
    </item>
  </channel>
</rss>

