<?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: Proc Export w/Where ddmmyyyy in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179766#M45864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message is because you left off the closing right parenthesis for your data set options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does not matter what format you have chosen to display the dates the WHERE clause is going to act on the actual VALUE that is stored.&lt;/P&gt;&lt;P&gt; In the case of a date that is the number of days since 1/1/1960.&amp;nbsp; You also just use date_received = 11757 if you wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x='10MAR1992'd ;&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put x= / x= date9. / x=mmddyy10. / x= yymmdd10. ;&lt;/P&gt;&lt;P&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=11757&lt;/P&gt;&lt;P&gt;x=10MAR1992&lt;/P&gt;&lt;P&gt;x=03/10/1992&lt;/P&gt;&lt;P&gt;x=1992-03-10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Apr 2014 21:38:12 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-04-14T21:38:12Z</dc:date>
    <item>
      <title>Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179760#M45858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to proc export with a where clause on a date column and it's not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it has something to do with the format of the date variables: ddmmyyyy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc export data=MAUDE.Total1999thru2013 (where=(DATE_RECEIVED='03/10/1992'))&lt;/P&gt;&lt;P&gt;dbms=excel file="...\Output\test9.xls";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error message is:&lt;/P&gt;&lt;P&gt;OTE: File "...&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;\Output\test9.xls" will be created if the export process succeeds.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/P&gt;&lt;P&gt;ERROR: Export unsuccessful.&amp;nbsp; See SAS Log for details.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE EXPORT used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.85 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.17 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any tips or wise words?&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11672i613E328CAC92DBC4/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="additional information.JPG" title="additional information.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11673iCD15765C063E86F8/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="additional information 2.jpg" title="additional information 2.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 19:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179760#M45858</guid>
      <dc:creator>Tegan</dc:creator>
      <dc:date>2014-04-14T19:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179761#M45859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is really a date variable they you should use a date value and not a character string in your WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where=(DATE_RECEIVED='10MAR1992'D)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 19:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179761#M45859</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-04-14T19:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179762#M45860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My data is in format dd/mm/yyyy, and I'm still getting an error, albeit a different one...&lt;IMG alt="additional information 2.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/5972_additional information 2.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;456&amp;nbsp; Proc export data=MAUDE.Total1999thru2013 where=(DATE_RECEIVED='10MAR1992'D)&lt;/P&gt;&lt;P&gt;457&amp;nbsp; dbms=excel file="="...&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;\Output\test9.xls";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;458&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;459&amp;nbsp; Proc export data=MAUDE.Total1999thru2013 where=(DATE_RECEIVED='10MAR1992'D)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DBLABEL, DBMS, DEBUG,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILE, LABEL, OUTFILE, OUTTABLE, REPLACE, TABLE, _DEBUG_.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179762#M45860</guid>
      <dc:creator>Tegan</dc:creator>
      <dc:date>2014-04-14T21:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179763#M45861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And date literal can only be used used as '10MAR1992'd, if you try '01/10/1992'd that will also fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179763#M45861</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-04-14T21:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179764#M45862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does that mean I have to change all the dates in that column to a '10MAR1992' format?&amp;nbsp; How do I do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179764#M45862</guid>
      <dc:creator>Tegan</dc:creator>
      <dc:date>2014-04-14T21:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179765#M45863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the actual values in the date variable numbers formatted as SAS dates?&amp;nbsp; If they are, Tom's suggested code should do what you want without you having to change your data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179765#M45863</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-14T21:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179766#M45864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message is because you left off the closing right parenthesis for your data set options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does not matter what format you have chosen to display the dates the WHERE clause is going to act on the actual VALUE that is stored.&lt;/P&gt;&lt;P&gt; In the case of a date that is the number of days since 1/1/1960.&amp;nbsp; You also just use date_received = 11757 if you wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x='10MAR1992'd ;&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put x= / x= date9. / x=mmddyy10. / x= yymmdd10. ;&lt;/P&gt;&lt;P&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=11757&lt;/P&gt;&lt;P&gt;x=10MAR1992&lt;/P&gt;&lt;P&gt;x=03/10/1992&lt;/P&gt;&lt;P&gt;x=1992-03-10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179766#M45864</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-04-14T21:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179767#M45865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These are the column attributes. The file is an import from Excel, and I have not done anything to the formatting.&lt;IMG alt="additional information.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/5973_additional information.JPG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179767#M45865</guid>
      <dc:creator>Tegan</dc:creator>
      <dc:date>2014-04-14T21:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179768#M45866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at Tom's last response: you left off two parentheses. Instead of:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Proc export data=MAUDE.Total1999thru2013 where=(DATE_RECEIVED='10MAR1992'D)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;use&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Proc export data=MAUDE.Total1999thru2013 (where=(DATE_RECEIVED='10MAR1992'D))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179768#M45866</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-14T21:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export w/Where ddmmyyyy</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179769#M45867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After getting over some of my lazy Monday coding, Tom's suggestion worked!&amp;nbsp; Thank, Tom!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 21:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Export-w-Where-ddmmyyyy/m-p/179769#M45867</guid>
      <dc:creator>Tegan</dc:creator>
      <dc:date>2014-04-14T21:49:03Z</dc:date>
    </item>
  </channel>
</rss>

