<?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: datetime function MDY problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38682#M7800</link>
    <description>Hi:&lt;BR /&gt;
  I always use a comma. Although I believe in some circumstances, the IN operator will be forgiving.&lt;BR /&gt;
 &lt;BR /&gt;
When in doubt, it's always a good idea to check the documentation.&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/a000780367.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/a000780367.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Wed, 23 Jun 2010 02:21:57 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-06-23T02:21:57Z</dc:date>
    <item>
      <title>datetime function MDY problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38679#M7797</link>
      <description>This seems like a simple problem, but it's making me crazy.&lt;BR /&gt;
&lt;BR /&gt;
So I'm trying to say that if a date variable (disc_date) is equal to one of a certain set of dates, it should be set to missing.&lt;BR /&gt;
&lt;BR /&gt;
Here is the code i'm using:&lt;BR /&gt;
&lt;BR /&gt;
if disc_date in (MDY(10,13,2003),MDY(11,11,2003),MDY(11,27,2003),MDY(11,28,2003),MDY(1,19,2004),MDY(2,12,2004),MDY(2,16,2004),MDY(3,1,2004),MDY(5,31,2004)) then disc_date = .D;      &lt;BR /&gt;
&lt;BR /&gt;
I get the error:&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value, iterator, (. &lt;BR /&gt;
&lt;BR /&gt;
indicating the first "MDY" function. &lt;BR /&gt;
Why doesn't it like this??&lt;BR /&gt;
&lt;BR /&gt;
Anyone have any ideas?</description>
      <pubDate>Mon, 21 Jun 2010 19:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38679#M7797</guid>
      <dc:creator>jetia13</dc:creator>
      <dc:date>2010-06-21T19:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function MDY problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38680#M7798</link>
      <description>try using this&lt;BR /&gt;
&lt;BR /&gt;
  if disc_date in ( '13oct2003'd ) then disc_date = .;&lt;BR /&gt;
&lt;BR /&gt;
GL</description>
      <pubDate>Mon, 21 Jun 2010 20:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38680#M7798</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-21T20:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function MDY problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38681#M7799</link>
      <description>I thought the in (a b c d) didn't use comma's.  &lt;BR /&gt;
&lt;BR /&gt;
Ie &lt;BR /&gt;
&lt;BR /&gt;
(MDY(10,13,2003) MDY(11,11,2003) MDY(11,27,2003)) might work.</description>
      <pubDate>Tue, 22 Jun 2010 20:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38681#M7799</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2010-06-22T20:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function MDY problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38682#M7800</link>
      <description>Hi:&lt;BR /&gt;
  I always use a comma. Although I believe in some circumstances, the IN operator will be forgiving.&lt;BR /&gt;
 &lt;BR /&gt;
When in doubt, it's always a good idea to check the documentation.&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/a000780367.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/a000780367.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 23 Jun 2010 02:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38682#M7800</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-23T02:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function MDY problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38683#M7801</link>
      <description>hi all,&lt;BR /&gt;
&lt;BR /&gt;
that error is not because of comma or space delimiter.&lt;BR /&gt;
its becas of using sas function inside the IN operator.&lt;BR /&gt;
We should have to use numeric or character constants as arguments for IN operator (not sas functions....)&lt;BR /&gt;
&lt;BR /&gt;
It doesn't matter whether u r using comma or space as delimiter. both r acceptable.&lt;BR /&gt;
&lt;BR /&gt;
Pavan.

Message was edited by: Pavan@SAS</description>
      <pubDate>Wed, 23 Jun 2010 12:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38683#M7801</guid>
      <dc:creator>Pavan_SAS</dc:creator>
      <dc:date>2010-06-23T12:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: datetime function MDY problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38684#M7802</link>
      <description>You are correct that the original error was the use of the MDY function with the IN operator, when the date constant or a SAS date value would have been the preferred approach.&lt;BR /&gt;
 &lt;BR /&gt;
However, my comment was ONLY addressing the use of commas or not. IN &lt;U&gt;will&lt;/U&gt;  allow spaces, but the documentation shows the use of commas. &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 23 Jun 2010 15:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-function-MDY-problem/m-p/38684#M7802</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-23T15:07:29Z</dc:date>
    </item>
  </channel>
</rss>

