<?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: Help with date=mm/dd/yy in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419754#M103237</link>
    <description>&lt;P&gt;The format of the date is :MMDDYY8.&lt;/P&gt;
&lt;P&gt;and here is the notice:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;10581&lt;BR /&gt;10582 data a; set timehour;&lt;BR /&gt;10583 if date='11/29/17'd ;run;&lt;BR /&gt; -----------&lt;BR /&gt; 77&lt;BR /&gt;ERROR: Invalid date/time/datetime constant '11/29/17'd.&lt;/P&gt;
&lt;P&gt;ERROR 77-185: Invalid number conversion on '11/29/17'd.&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.A may be incomplete. When this step was stopped there were 0 observations&lt;BR /&gt; and 10 variables.&lt;BR /&gt;WARNING: Data set WORK.A was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.00 seconds&lt;/P&gt;</description>
    <pubDate>Sat, 09 Dec 2017 00:56:04 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2017-12-09T00:56:04Z</dc:date>
    <item>
      <title>Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419751#M103235</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to run this code but clearly I missed something.&lt;/P&gt;
&lt;P&gt;Any help please?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a; set timehour;
if date='11/29/17'd ;run;


but this one works

data a; set timehour;
if date='29NOV17'd ;
if date='29NOV2017'd ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Dec 2017 00:50:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419751#M103235</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-12-09T00:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419753#M103236</link>
      <description>&lt;P&gt;Doesn't look like you missed anything to me.&amp;nbsp; Date literals must use the DATE format.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 00:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419753#M103236</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-09T00:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419754#M103237</link>
      <description>&lt;P&gt;The format of the date is :MMDDYY8.&lt;/P&gt;
&lt;P&gt;and here is the notice:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;10581&lt;BR /&gt;10582 data a; set timehour;&lt;BR /&gt;10583 if date='11/29/17'd ;run;&lt;BR /&gt; -----------&lt;BR /&gt; 77&lt;BR /&gt;ERROR: Invalid date/time/datetime constant '11/29/17'd.&lt;/P&gt;
&lt;P&gt;ERROR 77-185: Invalid number conversion on '11/29/17'd.&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.A may be incomplete. When this step was stopped there were 0 observations&lt;BR /&gt; and 10 variables.&lt;BR /&gt;WARNING: Data set WORK.A was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 00:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419754#M103237</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-12-09T00:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419758#M103240</link>
      <description>&lt;P&gt;The format of your date constant is invalid - it has to be the day of the month, the three letter abbreviation of the month and the year&amp;nbsp;(all in quotes) followed by a d. In your case that would be '29NOV2017'd&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 01:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419758#M103240</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-12-09T01:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419759#M103241</link>
      <description>&lt;P&gt;If does not make any difference what format is attached to your variable. Date constants are always expressed using strings in a form that the DATE informat can recognize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dates are stored in SAS as the number of days since '01JAN1960'd.&amp;nbsp; There are many formats that work with date values so that you can print them in a form that is understandable to you.&amp;nbsp; If fact you can attach any numeric format to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;565  data _null_;
566    date='29NOV2017'd ;
567    put (4*date) (date11. +1 mmddyy10. +1 yymmdd10. +1 comma7. ) ;
568  run;

29-NOV-2017 11/29/2017 2017-11-29  21,152&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 01:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419759#M103241</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-09T01:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419780#M103251</link>
      <description>&lt;P&gt;SAS has only one syntax for date literals, the one that worked (either 2- or 4-digit years). If you want to compare your date with another date format, use either put() or input() functions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if put(mydate,yymmddd10.) = '2017-12-08' then .....;
if mydate = input('2017-12-08',yymmdd10.) then ......;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Dec 2017 07:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/419780#M103251</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-09T07:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with date=mm/dd/yy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/420301#M103423</link>
      <description>&lt;P&gt;However dates past year 9999 must use a 5 digit year in a literal and cannot exceed 31DEC20000. &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 22:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-date-mm-dd-yy/m-p/420301#M103423</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-11T22:43:30Z</dc:date>
    </item>
  </channel>
</rss>

