<?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: Change date format in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214265#M5096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What software are you using? Base SAS, Enterprise Guide, SAS Data Management, SAS Data Integration, etc.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-shawn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2015 20:16:50 GMT</pubDate>
    <dc:creator>skillman</dc:creator>
    <dc:date>2015-06-25T20:16:50Z</dc:date>
    <item>
      <title>Change date format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214264#M5095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; font-size: 15px; background-color: rgba(255, 255, 255, 0.529412);"&gt;I have dates stored in character format. They look like - "15Jul2014". I need to convert it into 2014-Jul-15 i.e. &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; font-size: 15px; line-height: 1.5em; background-color: rgba(255, 255, 255, 0.529412);"&gt;YYYY-MMM-DD &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; font-size: 15px; line-height: 1.5em; background-color: rgba(255, 255, 255, 0.529412);"&gt;. Is there any easy way to convert it? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; font-size: 15px; background-color: rgba(255, 255, 255, 0.529412);"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in anticipation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 19:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214264#M5095</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-06-25T19:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change date format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214265#M5096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What software are you using? Base SAS, Enterprise Guide, SAS Data Management, SAS Data Integration, etc.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-shawn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 20:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214265#M5096</guid>
      <dc:creator>skillman</dc:creator>
      <dc:date>2015-06-25T20:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change date format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214266#M5097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using Base SAS. Does your answer vary in Base SAS and SAS Enterprise Guide? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 20:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214266#M5097</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-06-25T20:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change date format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214267#M5098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to define a format for yourself .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #353535; font-family: Lato, sans-serif; font-size: 14px;"&gt;&lt;/P&gt;&lt;H3&gt;Code: Program&lt;/H3&gt;&lt;DIV class="sce-html-export" style="font-family: 'Courier New', Menlo, 'Lucida Console';"&gt;&lt;PRE class="sce-render" style="font-family: 'Courier New', Menlo, 'Lucida Console'; font-size: 16px;"&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;proc&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;format&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;picture&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;fmt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;low&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;high&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'%Y-%b-%0d'&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;datatype&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;date&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;x&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;a&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="date" style="color: #008080; font-weight: bold;"&gt;'15Jul2014'd&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;a&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;fmt12.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;SPAN class="sep" style="color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 14:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214267#M5098</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-06-26T14:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Change date format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214268#M5099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively just create a text field:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length new_date $10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_date=catx('-',substr(old_date,6,4),substr(old_date,3,3),substr(old_date,1,2));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 14:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214268#M5099</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-06-26T14:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change date format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214269#M5100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ujjawal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is your date really a character variable? If so, I would urge you to convert it into a SAS date value first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your date is stored as a SAS date value, RW9's solution won't work without additional coding. If it is a character value, then you won't be able to do any calulations with it without code to do that transformation to a SAS date value. Xia's solution is the easiest way of dealing with the fact that SAS does not have every possible date format available. Only change I would make is I would use a more descriptive format name than "fmt". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMHO, there is no reason to represent a date as a character variable in a SAS table or view, UNLESS you are dealing with complex ISO8601 dates and need to calculate ISO durations and intervals using CALL IS8601_CONVERT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Derek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 16:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Change-date-format/m-p/214269#M5100</guid>
      <dc:creator>cov_derek</dc:creator>
      <dc:date>2015-06-26T16:11:25Z</dc:date>
    </item>
  </channel>
</rss>

