1

I have created dataset table_db1 as below:

proc sql;
CONNECT TO ORACLE (DB1 details);
CREATE TABLE table_db1 AS SELECT * FROM CONNECTION TO ORACLE 
(select * from db1.table where rownum<10);
quit;

I would like to use this data set to perform joins with data from another DB2. I prefer pass-through as it will allow me to use WITH clause. My first attempt below did not run successfully as the pass-through looks for table_db1 in DB2. Please suggest a work around.

proc sql;
CONNECT TO ORACLE (DB2 details);
CREATE TABLE table_db1 AS SELECT * FROM CONNECTION TO ORACLE 
(select * from db2.table2 a inner join table_db1 b
on a.var_name = b.var_name
where rownum<10);
quit;
Joe
  • 62,789
  • 6
  • 49
  • 67
user1124702
  • 1,015
  • 4
  • 12
  • 22
  • Pass-through code runs entirely on the DBMS. You need to talk to your DBA about transferring data between databases or connecting from one database to another. – david25272 Aug 07 '17 at 03:00

1 Answers1

2

Passthrough means SAS is simply sending code to the external DBMS. So if your external DBMS can connect to the other DB, then it can (perhaps) do it in the passthrough.

In general, though, no, you cannot use passthrough this way. You need to use Libname method if you're going to ask SAS to handle the database connectivity.

Joe
  • 62,789
  • 6
  • 49
  • 67