<?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 from a character format to a date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16562#M2313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't say how you are reading the data but when you indicate " for one reason or another, one of the date variables is coming in as a character variable" I suspect proc import.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Import uses lots of defaults and limited information from the source data. You might be able to write a datastep to read the data source and apply an informat at that time, but without details of the source data this is a guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 17:49:15 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-05-29T17:49:15Z</dc:date>
    <item>
      <title>Converting dates from a character format to a date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16559#M2310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a data set where, for one reason or another, one of the date variables is coming in as a character variable. Missing variables are blank, dates are present as things like 01-Nov-08. I need these in the proper SAS days-since-1/1/1960 format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using %sysfunc, but I can't seem to get it to cooperate. Any chance someone can point me in the right direction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2011 09:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16559#M2310</guid>
      <dc:creator>epigrad</dc:creator>
      <dc:date>2011-09-26T09:31:50Z</dc:date>
    </item>
    <item>
      <title>Converting dates from a character format to a date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16560#M2311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use function input to get that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num_date=input(char_date,date12.);&lt;/P&gt;&lt;P&gt;format num_date mmddyy12.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2011 09:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16560#M2311</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-09-26T09:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Converting dates from a character format to a date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16561#M2312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it the only way to do? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 17:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16561#M2312</guid>
      <dc:creator>andy_wk</dc:creator>
      <dc:date>2014-05-29T17:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Converting dates from a character format to a date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16562#M2313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't say how you are reading the data but when you indicate " for one reason or another, one of the date variables is coming in as a character variable" I suspect proc import.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Import uses lots of defaults and limited information from the source data. You might be able to write a datastep to read the data source and apply an informat at that time, but without details of the source data this is a guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 17:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16562#M2313</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-29T17:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting dates from a character format to a date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16563#M2314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;invalue $fmt&lt;/P&gt;&lt;P&gt; 'Nov'=11&lt;/P&gt;&lt;P&gt; 'Dec'=12&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;num_date=mdy(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input(scan(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;char_date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;,'-',2),$fmt.),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input(scan(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;char_date&lt;/SPAN&gt;,'-',1),best8.),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em; background-color: #ffffff;"&gt;input(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;scan(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;char_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;,'-',-1),best8.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em; background-color: #ffffff;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 15:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-dates-from-a-character-format-to-a-date-format/m-p/16563#M2314</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-30T15:09:53Z</dc:date>
    </item>
  </channel>
</rss>

