<?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 deleting the data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392437#M94425</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to delete the data from customer table where start_date is in datetime .It has values like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start_date&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro lzlib;&lt;BR /&gt;&lt;BR /&gt;LIBNAME LZZ OLEDB BULKLOAD=YES&lt;BR /&gt;DBCOMMIT=0&lt;BR /&gt;CURSOR_TYPE=STATIC&lt;BR /&gt;BL_KEEPIDENTITY=YES&lt;BR /&gt;BL_KEEPNULLS=NO&lt;BR /&gt;DIRECT_EXE=DELETE&lt;BR /&gt;PROPERTIES=('Integrated Security'=SSPI&lt;BR /&gt;'Persist Security Info'=TRUE&lt;BR /&gt;'Initial Catalog'=Customer_account)&lt;BR /&gt;PROMPT=NO&lt;BR /&gt;REREAD_EXPOSURE=NO&lt;BR /&gt;PROVIDER=SQLOLEDB&lt;BR /&gt;DATASOURCE="dwh-i-sql"&lt;BR /&gt;SCHEMA=DZS&lt;BR /&gt;ROWSET_SIZE=32767&lt;BR /&gt;UPDATE_MULT_ROWS=YES&lt;BR /&gt;PRESERVE_GUID=yes;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;delete from LZZ.customer&lt;BR /&gt;where start_date=1819843200;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the error that is coming&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Open cursor error: ICommand::Execute failed. : The requested properties cannot be supported.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2017 06:13:43 GMT</pubDate>
    <dc:creator>Rohit12</dc:creator>
    <dc:date>2017-09-01T06:13:43Z</dc:date>
    <item>
      <title>deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392437#M94425</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to delete the data from customer table where start_date is in datetime .It has values like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start_date&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;2017-09-01 00:00:00.000&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro lzlib;&lt;BR /&gt;&lt;BR /&gt;LIBNAME LZZ OLEDB BULKLOAD=YES&lt;BR /&gt;DBCOMMIT=0&lt;BR /&gt;CURSOR_TYPE=STATIC&lt;BR /&gt;BL_KEEPIDENTITY=YES&lt;BR /&gt;BL_KEEPNULLS=NO&lt;BR /&gt;DIRECT_EXE=DELETE&lt;BR /&gt;PROPERTIES=('Integrated Security'=SSPI&lt;BR /&gt;'Persist Security Info'=TRUE&lt;BR /&gt;'Initial Catalog'=Customer_account)&lt;BR /&gt;PROMPT=NO&lt;BR /&gt;REREAD_EXPOSURE=NO&lt;BR /&gt;PROVIDER=SQLOLEDB&lt;BR /&gt;DATASOURCE="dwh-i-sql"&lt;BR /&gt;SCHEMA=DZS&lt;BR /&gt;ROWSET_SIZE=32767&lt;BR /&gt;UPDATE_MULT_ROWS=YES&lt;BR /&gt;PRESERVE_GUID=yes;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;delete from LZZ.customer&lt;BR /&gt;where start_date=1819843200;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the error that is coming&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Open cursor error: ICommand::Execute failed. : The requested properties cannot be supported.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 06:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392437#M94425</guid>
      <dc:creator>Rohit12</dc:creator>
      <dc:date>2017-09-01T06:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392450#M94434</link>
      <description>&lt;P&gt;The Error you have reported is coming when you are comipiling the macro or after calling the macro ??&amp;nbsp;&lt;BR /&gt;if possible can you please provide full log for the same ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 07:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392450#M94434</guid>
      <dc:creator>cpagrawal</dc:creator>
      <dc:date>2017-09-01T07:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392464#M94441</link>
      <description>&lt;P&gt;Now I have tried this code but it is not woking&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro lzlib;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LIBNAME LZZ OLEDB BULKLOAD=YES&lt;BR /&gt;DBCOMMIT=0&lt;BR /&gt;CURSOR_TYPE=STATIC&lt;BR /&gt;BL_KEEPIDENTITY=YES&lt;BR /&gt;BL_KEEPNULLS=NO&lt;BR /&gt;DIRECT_EXE=DELETE&lt;BR /&gt;PROPERTIES=('Integrated Security'=SSPI&lt;BR /&gt;'Persist Security Info'=TRUE&lt;BR /&gt;'Initial Catalog'=Customer_account)&lt;BR /&gt;PROMPT=NO&lt;BR /&gt;REREAD_EXPOSURE=NO&lt;BR /&gt;PROVIDER=SQLOLEDB&lt;BR /&gt;DATASOURCE="dwh-i-sql"&lt;BR /&gt;SCHEMA=DZS&lt;BR /&gt;ROWSET_SIZE=32767&lt;BR /&gt;UPDATE_MULT_ROWS=YES&lt;BR /&gt;PRESERVE_GUID=yes;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;delete from LZZ.customer&lt;BR /&gt;where START_DATO='2017-09-01 00:00:00.000';&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OLEDB: AUTOCOMMIT turned ON for connection id 4 771 1819876483 Main 0 OBJECT_E&lt;BR /&gt;OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 4 772 1819876483 Main 0 OBJECT_E&lt;BR /&gt;OLEDB: AUTOCOMMIT turned OFF for connection id 4 773 1819876483 Main 0 OBJECT_E&lt;BR /&gt;NOTE: Libref LZZ was successfully assigned as follows:&lt;BR /&gt;Engine: OLEDB&lt;BR /&gt;Physical Name: SQLOLEDB&lt;BR /&gt;&lt;BR /&gt;OLEDB: AUTOCOMMIT turned ON for connection id 5 774 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 5 775 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: AUTOCOMMIT turned OFF for connection id 5 776 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: AUTOCOMMIT turned ON for connection id 5 777 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 5 778 1819876483 Main 0 SQL (2)&lt;BR /&gt;779 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB_47: Prepared: on connection 5 780 1819876483 Main 0 SQL (2)&lt;BR /&gt;SELECT * FROM "LZS"."customer" 781 1819876483 Main 0 SQL (2)&lt;BR /&gt;782 1819876483 Main 0 SQL (2)&lt;BR /&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;BR /&gt;OLEDB: AUTOCOMMIT turned ON for connection id 5 783 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 5 784 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: AUTOCOMMIT turned OFF for connection id 5 785 1819876483 Main 0 SQL (2)&lt;BR /&gt;SAS_SQL: The statement cannot be processed directly by the database because the DBIDIRECTEXEC option&lt;BR /&gt;was not specified. This option replaces the DIRECT_EXE option for which support will be dropped in&lt;BR /&gt;the future. 786 1819876483 Main 0 SQL (2)&lt;BR /&gt;SAS_SQL: Unable to convert the query to a DBMS specific SQL statement due to an error. 787&lt;BR /&gt;1819876483 Main 0 SQL (2)&lt;BR /&gt;&lt;BR /&gt;OLEDB: AUTOCOMMIT turned ON for connection id 6 788 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 6 789 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB: AUTOCOMMIT turned OFF for connection id 6 790 1819876483 Main 0 SQL (2)&lt;BR /&gt;791 1819876483 Main 0 SQL (2)&lt;BR /&gt;OLEDB_48: Prepared: on connection 6 792 1819876483 Main 0 SQL (2)&lt;BR /&gt;SELECT * FROM "LZS"."customer" 793 1819876483 Main 0 SQL (2)&lt;BR /&gt;794 1819876483 Main 0 SQL (2)&lt;BR /&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;BR /&gt;OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 6 795 1819876483 Main 0 SQL (2)&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.18 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 09:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392464#M94441</guid>
      <dc:creator>Rohit12</dc:creator>
      <dc:date>2017-09-01T09:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392465#M94442</link>
      <description>&lt;P&gt;I'm not sure what RDBMS you're using but I have a feeling it might be related to the fact that you have CURSOR_TYPE=STATIC in your libname declaration. Try removing that and just going with the default.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 09:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392465#M94442</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-09-01T09:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392467#M94443</link>
      <description>&lt;P&gt;The answer is in the log&lt;/P&gt;&lt;PRE&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Sep 2017 09:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392467#M94443</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-09-01T09:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392469#M94445</link>
      <description>How can i remove this error and what is the solution</description>
      <pubDate>Fri, 01 Sep 2017 09:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392469#M94445</guid>
      <dc:creator>Rohit12</dc:creator>
      <dc:date>2017-09-01T09:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392480#M94453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;assuming start_date is character you could try&lt;/P&gt;&lt;PRE&gt;PROC SQL;
   CREATE TABLE test AS
      SELECT * 
      FROM LZZ.customer
   ;
   DELETE FROM test
   WHERE start_date EQ translate(put(1819843200,E8601dt23.3),' ','T')
   ;
QUIT;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Sep 2017 11:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392480#M94453</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-09-01T11:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: deleting the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392489#M94458</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120326"&gt;@Rohit12&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I should start to save away a standard answer/explanation for this issue as it comes up at least once a month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what happens here:&lt;/P&gt;
&lt;P&gt;You're using implicit SQL (=SAS flavour SQL) for execution in a database. The SAS/Access engine will translate this SAS SQL to the database flavour SQL and send it to the database for execution.&lt;/P&gt;
&lt;P&gt;What you need to do is to pass in your datetime value in a form so that SAS recognizes that this is a datetime value and can translate the string to something the database understands as a datetime value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way you're passing in the string in the moment:&lt;/P&gt;
&lt;PRE&gt;where START_DATO='01Sep2017:00:00:00.000'dt&lt;/PRE&gt;
&lt;P&gt;doesn't tell SAS that this is a string representing a datetime value. For SAS that's just a string (a sequence of characters). That's why you're getting the error:&lt;/P&gt;
&lt;PRE&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/PRE&gt;
&lt;P&gt;The following should work as it provides the instruction to SAS that it's dealing with a string that needs to be interpreted as a datetime value.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;where START_DATO='01Sep2017:00:00:00.000'dt&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 11:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-the-data/m-p/392489#M94458</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-09-01T11:31:37Z</dc:date>
    </item>
  </channel>
</rss>

