<?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: Convert numeric month to &amp;quot;mmm&amp;quot; string and use as filename in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/474147#M121780</link>
    <description>Thank you Ballardw. It's work!</description>
    <pubDate>Thu, 28 Jun 2018 16:07:38 GMT</pubDate>
    <dc:creator>BonnaryW</dc:creator>
    <dc:date>2018-06-28T16:07:38Z</dc:date>
    <item>
      <title>Convert numeric month to "mmm" string and use as filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/473935#M121686</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;I am trying to convert the pmons(numeric month)to monname3.&amp;nbsp;month.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let pmons = %sysfunc(month(%sysfunc(intnx(month,%sysfunc(date()),-1))));&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP file="C:\Reports\TEST_ME_&amp;amp;pmons&amp;amp;cyear..xls" style=sasweb&lt;/P&gt;&lt;P&gt;options(absolute_column_width='6,20,4');&lt;/P&gt;&lt;P&gt;PROC REPORT DATA=ME nowd;&lt;/P&gt;&lt;P&gt;column ID NAME CODE;&lt;/P&gt;&lt;P&gt;define ID / style(column)={tagattr='00000'};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My file name should be: TEST_ME_MAY2018.xls&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thank you.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 23:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/473935#M121686</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2018-06-27T23:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric month to "mmm" string and use as filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/473940#M121690</link>
      <description>&lt;P&gt;Since you have date value PUT it with the appropriate format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; pmons= &lt;/FONT&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(putn(&lt;/FONT&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(intnx(month,&lt;/FONT&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(date()),-1)),monname3.));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; &amp;amp;pmons;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 00:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/473940#M121690</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-28T00:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric month to "mmm" string and use as filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/473946#M121693</link>
      <description>&lt;P&gt;The second parameter in the %SYSFUNC() is a format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pmons= %sysfunc(intnx(month,%sysfunc(date()),-1),monname3.);

%put &amp;amp;pmons;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use SYSFUNC() once for the date() function and once for the INTNX and then apply the format. The format MONNAME3 works off a SAS date, not a month. So if MONTH() is applied, it returns a number from 1 to 12 but there is not a format to convert a value of 1 to 12 to a month name. You could create your own if desired.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you can get the full value, May2018 in a single macro variable as well:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pmons= %sysfunc(intnx(month,%sysfunc(date()),-1),monname3.);

%put &amp;amp;pmons;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49478"&gt;@BonnaryW&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;I am trying to convert the pmons(numeric month)to monname3.&amp;nbsp;month.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let pmons = %sysfunc(month(%sysfunc(intnx(month,%sysfunc(date()),-1))));&lt;/P&gt;
&lt;P&gt;ods tagsets.ExcelXP file="C:\Reports\TEST_ME_&amp;amp;pmons&amp;amp;cyear..xls" style=sasweb&lt;/P&gt;
&lt;P&gt;options(absolute_column_width='6,20,4');&lt;/P&gt;
&lt;P&gt;PROC REPORT DATA=ME nowd;&lt;/P&gt;
&lt;P&gt;column ID NAME CODE;&lt;/P&gt;
&lt;P&gt;define ID / style(column)={tagattr='00000'};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My file name should be: TEST_ME_MAY2018.xls&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thank you.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 01:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/473946#M121693</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-28T01:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric month to "mmm" string and use as filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/474146#M121779</link>
      <description>Thank you Reeza. It's work !!!&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Jun 2018 16:06:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/474146#M121779</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2018-06-28T16:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric month to "mmm" string and use as filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/474147#M121780</link>
      <description>Thank you Ballardw. It's work!</description>
      <pubDate>Thu, 28 Jun 2018 16:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-numeric-month-to-quot-mmm-quot-string-and-use-as/m-p/474147#M121780</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2018-06-28T16:07:38Z</dc:date>
    </item>
  </channel>
</rss>

