<?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: Date Formatting Errors with INPUT statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388296#M93113</link>
    <description>&lt;P&gt;So if your dates are in&amp;nbsp;&lt;SPAN&gt;MM/DD/YYYY format, why are you using date9. informat. Shouldn't you be using mmddyy10. infomat in your input function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Like-&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;data;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;data1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;newvar= INPUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(oldvar, mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;if newvar&amp;gt;'01JUL2014'd;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2017 20:44:19 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2017-08-15T20:44:19Z</dc:date>
    <item>
      <title>Date Formatting Errors with INPUT statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388295#M93112</link>
      <description>&lt;P&gt;I have a dataset where I have to convert dates (MM/DD/YYYY) from a character variable to a date variable.&lt;/P&gt;&lt;P&gt;After many different attempts, my code is still experiencing errors. Ultimately I want to convert the dates from character to numeric format&amp;nbsp;and restrict my dataset to those observations only with&amp;nbsp;date after 7/1/2014 following this step&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the error message is&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function INPUT"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; data; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; data1; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;newvar= INPUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(oldvar, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 20:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388295#M93112</guid>
      <dc:creator>newgrad</dc:creator>
      <dc:date>2017-08-15T20:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting Errors with INPUT statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388296#M93113</link>
      <description>&lt;P&gt;So if your dates are in&amp;nbsp;&lt;SPAN&gt;MM/DD/YYYY format, why are you using date9. informat. Shouldn't you be using mmddyy10. infomat in your input function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Like-&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;data;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;data1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;newvar= INPUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(oldvar, mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;if newvar&amp;gt;'01JUL2014'd;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 20:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388296#M93113</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-15T20:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting Errors with INPUT statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388488#M93181</link>
      <description>&lt;P&gt;It is good practice to assign some sort of date format to the result of a date value creation so us humans can see what date SAS resovled the value to.&lt;/P&gt;
&lt;P&gt;Sometimes people think there text variable is in a layout such as mm/dd/yyyy but SAS reports errors becaus the values are actually dd/mm/yyyy. Or they are mixed. 05/04/2017: is this actualy May 4 or Apr 5. The ones that do not get an error may give you some hints when you look at them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 14:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting-Errors-with-INPUT-statement/m-p/388488#M93181</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-16T14:54:25Z</dc:date>
    </item>
  </channel>
</rss>

