@Patrick wrote: If this table already exists then the DB will throw an error. I assume that's what happens in your case. Well, you assumed wrong... I confirmed that the table does NOT exist before running the code "data sqlite.shoes; ..." I looked via HeidiDB as well as a refresh of the explorer window. Use below options to get more information in the SAS log what actually gets sent to the DB for execution. OPTIONS SASTRACE=',,,d' SASTRACELOC=SASLOG NOSTSUFFIX; I will try that and report back. [Edit] For reference, when I run the datastep and the table exists, I get the following error in the log, compare to the original one I posted: ERROR: The ODBC table shoes has been opened for OUTPUT. This table already exists, or there is
a name conflict with an existing object. This table will not be replaced. This engine
does not support the REPLACE option.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds [Edit #2] Here is the SQL output if I do the data step above (knowing that sqlite.shoes does NOT exist): 18 data sqlite.shoes;
19 set sashelp.shoes;
20 run;
ODBC_4: Prepared: on connection 1
SELECT * FROM shoes WHERE 0=1
ODBC: AUTOCOMMIT is NO for connection 2
NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
ODBC_5: Executed: on connection 2
CREATE TABLE shoes (Region varchar(25),Product varchar(14),Subsidiary varchar(12),Stores
double,Sales double,Inventory double,Returns double)
ODBC: 0 row(s) affected by INSERT/UPDATE/DELETE or other statement.
ODBC: COMMIT performed on connection 2.
ERROR: Error attempting to CREATE a DBMS table. NOTE: No data found/modified..
NOTE: The DATA step has been abnormally terminated.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SQLITE.shoes may be incomplete. When this step was stopped there were 0
observations and 7 variables.
ODBC: ROLLBACK performed on connection 2.
ODBC: COMMIT performed on connection 2.
ERROR: ROLLBACK issued due to errors for data set SQLITE.shoes.DATA.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds I think it's very interesting but somewhat surprising. Also, I know by looking and inserting later that the table was definitely created on the SQLITE db. Thanks!
... View more