<?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: SAS character data to SAS date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362202#M85548</link>
    <description>&lt;P&gt;Read those dates, if you can't figure it out see the answer in the spoiler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;April 31st&amp;nbsp;&lt;/P&gt;
&lt;P&gt;September 31st&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;These dates don't exist in a calendar.&amp;nbsp;&lt;/LI-SPOILER&gt;</description>
    <pubDate>Sat, 27 May 2017 16:42:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-05-27T16:42:34Z</dc:date>
    <item>
      <title>SAS character data to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362168#M85529</link>
      <description>&lt;P&gt;Sorry to ask this question again.&lt;/P&gt;&lt;P&gt;I have the following character data column in a SAS dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exp_c&lt;BR /&gt;05/01/2018&lt;BR /&gt;04/31/2017&lt;BR /&gt;10/31/2017&lt;BR /&gt;01/1/1901&lt;BR /&gt;01/1/1901&lt;BR /&gt;01/1/1901&lt;BR /&gt;09/31/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column formating is Character&amp;nbsp;Format $12.&amp;nbsp; Informat $12.&amp;nbsp; Length 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following lines of code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want ;&amp;nbsp; set have&amp;nbsp; ;&amp;nbsp;&lt;BR /&gt;new_date = input (Exp_c ,ddmmyy10.) ;&lt;BR /&gt;format new_date ddmmyy10. ;&lt;BR /&gt;Put _ALL_ ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some dates convert and others do not.&amp;nbsp; THe following do not:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;04/31/2017&lt;/P&gt;&lt;P&gt;10/31/2017&lt;/P&gt;&lt;P&gt;09/31/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log message received is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"NOTE: Invalid argument to function INPUT at line 12045 column 12."&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;"NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set to missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 at 12045:12"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions ?&amp;nbsp; Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 13:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362168#M85529</guid>
      <dc:creator>rmacarthur</dc:creator>
      <dc:date>2017-05-27T13:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS character data to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362176#M85534</link>
      <description>&lt;P&gt;You've used&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ddmmyy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your data appears to be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mmddyy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the ones that don't convert have records where the day is greater than 12 which would not be a valid month so it creates the error you're seeing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 14:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362176#M85534</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-27T14:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS character data to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362200#M85546</link>
      <description>&lt;P&gt;Thank you, we're almost there.&amp;nbsp; Now, using this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want &amp;nbsp; ;&amp;nbsp; set have &amp;nbsp; ;&amp;nbsp;&lt;BR /&gt;new_date = input (Exp_c ,mmddyy10.) ;&lt;BR /&gt;format new_date mmddyy10. ;&lt;BR /&gt;&amp;nbsp;run ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two dates that still do not convert:&lt;/P&gt;&lt;P&gt;04/31/2017&lt;/P&gt;&lt;P&gt;09/31/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 16:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362200#M85546</guid>
      <dc:creator>rmacarthur</dc:creator>
      <dc:date>2017-05-27T16:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS character data to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362202#M85548</link>
      <description>&lt;P&gt;Read those dates, if you can't figure it out see the answer in the spoiler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;April 31st&amp;nbsp;&lt;/P&gt;
&lt;P&gt;September 31st&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;These dates don't exist in a calendar.&amp;nbsp;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Sat, 27 May 2017 16:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362202#M85548</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-27T16:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS character data to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362203#M85549</link>
      <description>&lt;P&gt;That is one of the major problems with collecting dates in character columns.&lt;/P&gt;
&lt;P&gt;Users can enter values that are not actual dates.&lt;/P&gt;
&lt;PRE&gt;How to Remember How Many Days Are in Each Month

Rhyme to remember number of days in each month:

30 days has September,
April, June, and November.
When short February's done
All the rest have 31...
&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28361"&gt;@rmacarthur&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, we're almost there.&amp;nbsp; Now, using this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want &amp;nbsp; ;&amp;nbsp; set have &amp;nbsp; ;&amp;nbsp;&lt;BR /&gt;new_date = input (Exp_c ,mmddyy10.) ;&lt;BR /&gt;format new_date mmddyy10. ;&lt;BR /&gt;&amp;nbsp;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two dates that still do not convert:&lt;/P&gt;
&lt;P&gt;04/31/2017&lt;/P&gt;
&lt;P&gt;09/31/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 16:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362203#M85549</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-27T16:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS character data to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362205#M85550</link>
      <description>&lt;P&gt;HaHa, data entry error, very good !&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 16:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-character-data-to-SAS-date/m-p/362205#M85550</guid>
      <dc:creator>rmacarthur</dc:creator>
      <dc:date>2017-05-27T16:44:54Z</dc:date>
    </item>
  </channel>
</rss>

