<?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 SAS Date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585277#M166890</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a SAS format to make the date appearing as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;04-Sep-2017&lt;/P&gt;&lt;P&gt;14-Jun-2015&lt;/P&gt;&lt;P&gt;21-May-2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;zimcom&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2019 16:30:07 GMT</pubDate>
    <dc:creator>zimcom</dc:creator>
    <dc:date>2019-08-30T16:30:07Z</dc:date>
    <item>
      <title>SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585277#M166890</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a SAS format to make the date appearing as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;04-Sep-2017&lt;/P&gt;&lt;P&gt;14-Jun-2015&lt;/P&gt;&lt;P&gt;21-May-2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;zimcom&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 16:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585277#M166890</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2019-08-30T16:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585282#M166892</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE class="xis-codeFragment"&gt;date11.;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data test;
input date :date11.;
format date date11.;
cards;
04-Sep-2017
14-Jun-2015
21-May-2016
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 16:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585282#M166892</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-30T16:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585285#M166893</link>
      <description>THANK YOU !!&lt;BR /&gt;Have a great weekend!</description>
      <pubDate>Fri, 30 Aug 2019 16:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585285#M166893</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2019-08-30T16:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585286#M166894</link>
      <description>&lt;P&gt;I checked but not sure if there is any such format, but if you need the date in that format probably you can try the below code with prxchange function which generates a character variable of date in the expected format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date:date10.;
new=prxchange('s/(\d{1,2})(\w{3})(\d{4})/$1-$2-$3/',-1,strip(put(date,date9.)));
format date date9.;
cards;
04-Sep-2017
14-Jun-2015
21-May-2016
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 16:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585286#M166894</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-30T16:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585287#M166895</link>
      <description>&lt;PRE class="xis-codeFragment"&gt;date11.;&lt;/PRE&gt;&lt;P&gt;works perfect!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 16:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585287#M166895</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2019-08-30T16:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585288#M166896</link>
      <description>Its interesting, I never used it. &lt;BR /&gt;Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; now i know when to use it.</description>
      <pubDate>Fri, 30 Aug 2019 16:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585288#M166896</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-30T16:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585349#M166911</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151"&gt;@Jagadishkatam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I checked but not sure if there is any such format, but if you need the date in that format probably you can try the below code with prxchange function which generates a character variable of date in the expected format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date:date10.;
new=prxchange('s/(\d{1,2})(\w{3})(\d{4})/$1-$2-$3/',-1,strip(put(date,date9.)));
format date date9.;
cards;
04-Sep-2017
14-Jun-2015
21-May-2016
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This looks like a case of using a tool one is more familiar with. Proc Format has a lot of options for making custom formats if one such as Date11 didn't work. Consider if the OP had wanted @ characters instead of dashes [admittedly not a likely need but to illustrate]:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
Picture mydatefmt (default=11)
  low-high= '%0d@%b@%Y' (datatype=date);
run;

data _null_;
   x='23JAN2019'd;
   put x= mydatefmt.;
run;&lt;/PRE&gt;
&lt;P&gt;So with the available format we don't have to modify the data set, just use the new format for the procedure output.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 20:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/585349#M166911</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-30T20:19:52Z</dc:date>
    </item>
  </channel>
</rss>

