<?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 number to date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500868#M133446</link>
    <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data example;
release_date=20180612; 
release_date = input(put(release_date,8.),yymmdd8.);
format release_date ddmmyy10.;

run;&lt;/PRE&gt;
&lt;P&gt;Another is to go back to when the data were read and use the yymmdd8. informat instead of 11.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 17:53:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-10-02T17:53:59Z</dc:date>
    <item>
      <title>Convert number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500860#M133443</link>
      <description>&lt;P&gt;I have a column/variable named&amp;nbsp;&lt;STRONG&gt;Release_Date&amp;nbsp;&lt;/STRONG&gt;with&amp;nbsp;&lt;STRONG&gt;length 8&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;format 11.&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;informat 11.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The observation in that column are in the form &lt;STRONG&gt;YYYYMMDD.&amp;nbsp;&lt;/STRONG&gt;SAS actually reads them as pure number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to convert those observation in&amp;nbsp;&lt;STRONG&gt;DD/MM/YYYY&amp;nbsp;&lt;/STRONG&gt;format with&amp;nbsp;&lt;STRONG&gt;format&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;informat as DDMMYY10.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Release_Date is &lt;STRONG&gt;20180612&amp;nbsp;&lt;/STRONG&gt;then I want&amp;nbsp;&lt;STRONG&gt;12/06/2018&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with this regard will be appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 17:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500860#M133443</guid>
      <dc:creator>Rookie_123</dc:creator>
      <dc:date>2018-10-02T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500868#M133446</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data example;
release_date=20180612; 
release_date = input(put(release_date,8.),yymmdd8.);
format release_date ddmmyy10.;

run;&lt;/PRE&gt;
&lt;P&gt;Another is to go back to when the data were read and use the yymmdd8. informat instead of 11.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 17:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500868#M133446</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-02T17:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500869#M133447</link>
      <description>&lt;P&gt;I read the date from Access database with PROC IMPORT and the data itself is in the format YYYYMMDD.&lt;/P&gt;&lt;P&gt;So I think while reading itself I will need to reverse the observations to be read as DD/MM/YYYY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont know if that is possible or not&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 17:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500869#M133447</guid>
      <dc:creator>Rookie_123</dc:creator>
      <dc:date>2018-10-02T17:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500873#M133450</link>
      <description>&lt;P&gt;Thanks the approach mentioned in the answer is perfect for my usecase&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 18:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500873#M133450</guid>
      <dc:creator>Rookie_123</dc:creator>
      <dc:date>2018-10-02T18:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500949#M133486</link>
      <description>&lt;P&gt;SAS a fairly large number of INFORMATS to read dates, times and datetimes&amp;nbsp;in a wide variety of common layouts. It is frequently much easier to find an informat than to write code to parse bits.&amp;nbsp;An important thing to remember is when using the INPUT function that it expects to read a character value and if your variable is actually numeric the default conversion may not work and you&amp;nbsp;may need to use a PUT function call with an appropriate format to match the INFORMAT you want to use in the INPUT call.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 20:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-number-to-date/m-p/500949#M133486</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-02T20:29:20Z</dc:date>
    </item>
  </channel>
</rss>

