<?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 dates - please help a novice in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/converting-dates-please-help-a-novice/m-p/73228#M21232</link>
    <description>Check the DOC and you will see that DATE9 is DDMMMYYYY format.  Your code worked for me:&lt;BR /&gt;
&lt;BR /&gt;
13   data _null_;&lt;BR /&gt;
14   old_var = '01apr2010';&lt;BR /&gt;
15   format new_var date9.;&lt;BR /&gt;
16   new_var=input(old_var, DATE9.);&lt;BR /&gt;
17   put _all_;&lt;BR /&gt;
18   run;&lt;BR /&gt;
&lt;BR /&gt;
old_var=01apr2010 new_var=01APR2010 _ERROR_=0 _N_=1&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.03 seconds&lt;BR /&gt;
      cpu time            0.00 second&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Also check the INFORMAT ANYDTDTE as well.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
converting dates site:sas.com</description>
    <pubDate>Fri, 02 Apr 2010 19:29:23 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-04-02T19:29:23Z</dc:date>
    <item>
      <title>converting dates - please help a novice</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-dates-please-help-a-novice/m-p/73227#M21231</link>
      <description>Hi there. I have a bunch of dates that I'm needing to subtract. When I imported the data from Excel, all of the dates were in the format of DATE9. except one (of course). This one annoying date is CHAR $8. Is there a *very* simple way to convert this date? I googled for solutions, and tried three different codes&lt;BR /&gt;
&lt;BR /&gt;
1- new_var=input(old_var, yymmdd10.);&lt;BR /&gt;
2- new_var=input(old_var, mmddyy9.);&lt;BR /&gt;
3- new_var=input(old_var, DATE9.);&lt;BR /&gt;
&lt;BR /&gt;
...but nothing's matching the format of the other vars (which in plain English, appear as DDMMMYYYY). Instead, the output shows all missing values with options 2 and 3. Option 1 results in a few of the dates converting properly, with the majority appearing as missing. &lt;BR /&gt;
&lt;BR /&gt;
I'm so frustrated, and have a dissertation to finish! I'd be so grateful for any help.&lt;BR /&gt;
&lt;BR /&gt;
Thanks so much in advance.</description>
      <pubDate>Fri, 02 Apr 2010 19:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-dates-please-help-a-novice/m-p/73227#M21231</guid>
      <dc:creator>kermit</dc:creator>
      <dc:date>2010-04-02T19:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: converting dates - please help a novice</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-dates-please-help-a-novice/m-p/73228#M21232</link>
      <description>Check the DOC and you will see that DATE9 is DDMMMYYYY format.  Your code worked for me:&lt;BR /&gt;
&lt;BR /&gt;
13   data _null_;&lt;BR /&gt;
14   old_var = '01apr2010';&lt;BR /&gt;
15   format new_var date9.;&lt;BR /&gt;
16   new_var=input(old_var, DATE9.);&lt;BR /&gt;
17   put _all_;&lt;BR /&gt;
18   run;&lt;BR /&gt;
&lt;BR /&gt;
old_var=01apr2010 new_var=01APR2010 _ERROR_=0 _N_=1&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.03 seconds&lt;BR /&gt;
      cpu time            0.00 second&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Also check the INFORMAT ANYDTDTE as well.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
converting dates site:sas.com</description>
      <pubDate>Fri, 02 Apr 2010 19:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-dates-please-help-a-novice/m-p/73228#M21232</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-04-02T19:29:23Z</dc:date>
    </item>
  </channel>
</rss>

