<?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: Month dates from number to letters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310486#M66985</link>
    <description>&lt;P&gt;Look at building a custom format, with PROC format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its easier than you think &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc format;&lt;/P&gt;
&lt;P&gt;picture ddmonyy other= "%0d/%b/%Y" (datatype=date);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2016 18:54:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-09T18:54:38Z</dc:date>
    <item>
      <title>Month dates from number to letters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310482#M66981</link>
      <description>&lt;P&gt;Hi to everybody!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with date formats. I've got a nice data set with this but the forma of my dates are for example: 02/11/2016. I need to put first the day, then month and then year. Untill here everything is ok but I would like to put them in this format: 02/NOV/2016 and I can't!&lt;/P&gt;&lt;P&gt;I wrote "&lt;SPAN&gt;Month = put(date,monname3.);" and now I've converted my variable month from number to Words but I am not able to put that in the way I want "&lt;SPAN&gt;02/NOV/2016" "24/FEB/2013", etc.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DatePA= left(fecha);&lt;BR /&gt;Day = SUBSTR(fechapa,7,2);&lt;BR /&gt;Month = SUBSTR(fechapa,5,2);&lt;BR /&gt;Year = SUBSTR(fechapa,1,4);&lt;BR /&gt;Date = MDY (Month,Day,Year);&lt;BR /&gt;Month = put(date,monname3.);&lt;BR /&gt;format Date ddmmyy10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 18:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310482#M66981</guid>
      <dc:creator>fconerj</dc:creator>
      <dc:date>2016-11-09T18:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Month dates from number to letters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310485#M66984</link>
      <description>&lt;P&gt;Investigate whether the requirements can be a little bit flexible.&amp;nbsp; It's very easy to come close to what you are asking for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;m1 = put(date, date11.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;m2 = put(date, date9.);&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 18:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310485#M66984</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-11-09T18:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Month dates from number to letters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310486#M66985</link>
      <description>&lt;P&gt;Look at building a custom format, with PROC format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its easier than you think &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc format;&lt;/P&gt;
&lt;P&gt;picture ddmonyy other= "%0d/%b/%Y" (datatype=date);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 18:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310486#M66985</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-09T18:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Month dates from number to letters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310491#M66990</link>
      <description>&lt;P&gt;When dealing with dates it is often easier to actually use a SAS date valued variable an a format. Your request for / in the middle of the date with the month name is uncommon but doable with a custom format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following code&amp;nbsp;creates a SAS date valued variable from&amp;nbsp;a character variable that I think mimics your fechapa variable.&lt;/P&gt;
&lt;P&gt;Then uses the custom format created with proc format to display the date as desired.&lt;/P&gt;
&lt;P&gt;NOTE: the case of the letters in the string '%d/%b/%Y' is critical as changing the Y to y will result in a 2 digit year and a %B instead of %b is the full name not the 3-letter abbreviation. The % tells proc format the values are directives and the datatype tells SAS what ranges of values to expect.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
   x='20160425';
   y=input(x,yymmdd8.);
   format y date9.;
run;

proc format library=work;
picture DateSlash  (default=12)
  low-high= '%d/%b/%Y'  ( datatype=date)
;
run;

proc print data=example;
   var y;
   format y dateslash.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So once you have your Date variable you use the format dateslash as needed. Note, since this is a custom format permanent association of the format means that you should place the format in a location that is always in the FMTSEARCH path OR rerun the proc format as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 19:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Month-dates-from-number-to-letters/m-p/310491#M66990</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-09T19:03:25Z</dc:date>
    </item>
  </channel>
</rss>

