<?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: formatting from number to date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397769#M96154</link>
    <description>&lt;P&gt;You can't format it as a date because for that to work, the number has to be a legitimate SAS date value, in other words, it must be the number of days since Jan 1, 1960. Try this UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;newvar=input(put(dtmep,$8.),yymmdd8.);&lt;BR /&gt;format newvar date8.;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Sep 2017 13:29:53 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-09-21T13:29:53Z</dc:date>
    <item>
      <title>formatting from number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397763#M96152</link>
      <description>&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a data which has numeric variable in the&amp;nbsp;following way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20061213&lt;BR /&gt;20061213&lt;BR /&gt;20061213&lt;BR /&gt;20061214&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried converting it in to date format by using following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;STRONG&gt;&lt;FONT color="#000080"&gt;data&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;TEST;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; recnou.rec19sep17;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; dtmep &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;date8.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; CDFPRO=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;'P'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; nocont cnp dtmep unpaid;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I'm getting following&amp;nbsp;output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;BR /&gt;********&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can any one please tell me the reason for the above output and how do I rectify the problem.&lt;/P&gt;&lt;P&gt;i want the date to be mm/dd/yyyy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Sep 2017 13:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397763#M96152</guid>
      <dc:creator>Unstefan</dc:creator>
      <dc:date>2017-09-21T13:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: formatting from number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397768#M96153</link>
      <description>If you have readable dates as numeric without a format, you need to transform the values.&lt;BR /&gt;First use put () to a text string, ind use input() to do the conversion using a specific informat that matches your current date format.</description>
      <pubDate>Thu, 21 Sep 2017 13:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397768#M96153</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-09-21T13:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: formatting from number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397769#M96154</link>
      <description>&lt;P&gt;You can't format it as a date because for that to work, the number has to be a legitimate SAS date value, in other words, it must be the number of days since Jan 1, 1960. Try this UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;newvar=input(put(dtmep,$8.),yymmdd8.);&lt;BR /&gt;format newvar date8.;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Sep 2017 13:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397769#M96154</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-09-21T13:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: formatting from number to date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397770#M96155</link>
      <description>&lt;P&gt;i solve it&amp;nbsp; right this&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; TEST;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; recnou.rec19sep17;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;DATE2 = INPUT(PUT(Dtmep,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;8.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;yyMMDD8.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;FORMAT&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; DATE2 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;MMDDYY10.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; CDFPRO=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;'P'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; nocont cnp date2 unpaid;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 13:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/formatting-from-number-to-date/m-p/397770#M96155</guid>
      <dc:creator>Unstefan</dc:creator>
      <dc:date>2017-09-21T13:29:12Z</dc:date>
    </item>
  </channel>
</rss>

