<?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: converting character date to numeric date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/converting-character-date-to-numeric-date/m-p/87583#M24991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need a format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: none repeat scroll 0% 0% white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt; new_Base_Date&lt;/STRONG&gt;=input(Base_Date,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: teal; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 10pt; background: none repeat scroll 0% 0% white; font-family: 'Courier New';"&gt; format &lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;new_Base_Date date9. ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: none repeat scroll 0% 0% white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2012 06:02:57 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2012-06-20T06:02:57Z</dc:date>
    <item>
      <title>converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-character-date-to-numeric-date/m-p/87582#M24990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;My SAS dataset named france has a variable Base_Date(Lenth:12, Format:$12, Informat:$12. Tpye: character). The obs. displayed like "2-Feb-06".&lt;/P&gt;&lt;P&gt;The attributes of Base_Date in other datasets are Lenth: 8 Format: DATE9.&amp;nbsp; Informat:DATE9.&amp;nbsp; Tpye: numeric and I want to convert the character date to numeric date just like the above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My commands are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; Base_Date=input(Base_Date,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;*failure, &lt;/SPAN&gt;obs. like "2-Feb-06" becomes "16834";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;*Lenth: 12 Format: $12. Informat: $12. Tpye: character remain the same;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried some commands like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; Base_Date=input(Base_Date,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;yymmdd8.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;*failure, all obs. of this variable &lt;/SPAN&gt;become missing values;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could anyone give me some suggestions? Also I want to know why the attributes of Base_Date in a dataset are different from that in other datasets given that I import the data from the same type of file (CSV) to SAS using the same commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 05:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-character-date-to-numeric-date/m-p/87582#M24990</guid>
      <dc:creator>comeon2012</dc:creator>
      <dc:date>2012-06-20T05:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-character-date-to-numeric-date/m-p/87583#M24991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need a format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: none repeat scroll 0% 0% white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt; france;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt; new_Base_Date&lt;/STRONG&gt;=input(Base_Date,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: teal; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 10pt; background: none repeat scroll 0% 0% white; font-family: 'Courier New';"&gt; format &lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;new_Base_Date date9. ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: none repeat scroll 0% 0% white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 06:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-character-date-to-numeric-date/m-p/87583#M24991</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-20T06:02:57Z</dc:date>
    </item>
  </channel>
</rss>

