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;