<?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 text into date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144169#M261827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the strip function didnt seem to work, aim on sas 9.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jun 2014 03:18:44 GMT</pubDate>
    <dc:creator>Stan_G</dc:creator>
    <dc:date>2014-06-18T03:18:44Z</dc:date>
    <item>
      <title>Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144159#M261817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am relatively new at this and always find this tricky i have fields that are like&lt;STRONG&gt; 1/7/2011 12/11/2013&lt;/STRONG&gt; etc, and they are text, how do i turn these into proper sas dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking in advance,&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 07:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144159#M261817</guid>
      <dc:creator>Stan_G</dc:creator>
      <dc:date>2014-06-17T07:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144160#M261818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are these dates in text files or a sas dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 07:27:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144160#M261818</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-06-17T07:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144161#M261819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;a='1/7/2011';&lt;/P&gt;&lt;P&gt;b=input(put(a,8.),mmddyy10.);&lt;/P&gt;&lt;P&gt;put b/b=mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 10:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144161#M261819</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-06-17T10:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144162#M261820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Per slchen you would use the input function to convert text strings into numeric variables (which are what date/time variables are in SAS).&amp;nbsp; The input requires you to specify the format of the data, length.&amp;nbsp; So in your example your date value is 10 characters, mm/dd/yyyy, spaces are interpreted as 0.&amp;nbsp; So the format to read this in would be mmddyy10.&amp;nbsp; If you have only a two digit year then: mm/dd/yy, so the format is mmddyy8.&amp;nbsp; The input reads in the text string and converts it to numeric SAS date which can have a format applied to it to show the date representation - otherwise you will just see a number.&amp;nbsp; The reverse of course is put which takes a numeric and puts it into a character string. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 10:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144162#M261820</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-17T10:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144163#M261821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These are variables within a dataset, I've tried&amp;nbsp; this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data _null_;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;a='1/7/2011';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;b=input(put(a,8.),mmddyy10.);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;put b/b=mmddyy10.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;but that dont seem to work, any other suggestions will be greatly apreciated.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Many thanks,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 23:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144163#M261821</guid>
      <dc:creator>Stan_G</dc:creator>
      <dc:date>2014-06-17T23:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144164#M261822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input date :$10.;&lt;/P&gt;&lt;P&gt;_date=input(strip(date),mmddyy10.);&lt;/P&gt;&lt;P&gt;format _date mmddyy10.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1/7/2011 &lt;/P&gt;&lt;P&gt;2/19/2011&lt;/P&gt;&lt;P&gt;10/13/2012&lt;/P&gt;&lt;P&gt;12/11/2013 &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 00:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144164#M261822</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-06-18T00:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144165#M261823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kinda looks like the same question as the just-posted &lt;A _jive_internal="true" href="https://communities.sas.com/message/215994#215994"&gt;https://communities.sas.com/message/215994#215994&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 00:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144165#M261823</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-06-18T00:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144166#M261824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry mate how would you do the same on the existing data set rather than the one you have created?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 00:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144166#M261824</guid>
      <dc:creator>Stan_G</dc:creator>
      <dc:date>2014-06-18T00:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144167#M261825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; _date=input(strip(date),mmddyy10.);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; format _date mmddyy10.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 01:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144167#M261825</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-06-18T01:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144168#M261826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the solution here it is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt; new_date = input (date,ddmmyy10.) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format new_date ddmmyy10. ;&lt;/P&gt;&lt;P&gt; put _all_ ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 03:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144168#M261826</guid>
      <dc:creator>Stan_G</dc:creator>
      <dc:date>2014-06-18T03:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144169#M261827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the strip function didnt seem to work, aim on sas 9.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 03:18:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144169#M261827</guid>
      <dc:creator>Stan_G</dc:creator>
      <dc:date>2014-06-18T03:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converting text into date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144170#M261828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If strip() is not available use trim(left(...))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2014 10:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-text-into-date/m-p/144170#M261828</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-06-19T10:52:11Z</dc:date>
    </item>
  </channel>
</rss>

