BookmarkSubscribeRSS Feed
kiranv_
Rhodochrosite | Level 12

I am confused now. what exactly you are trying to achieve. 

Peter_B
Calcite | Level 5

Sorry, I meant a working example of some code but it's not going to be possible as a Pass Through would be required. Thanks, I'll give this a try.

SuryaKiran
Meteorite | Level 14

First thing is you need to understand how pass-through works. Pass-Through queries are used to send DBMS specific statements and retrieve DBMS data. You need to specify DBMS SQL syntax instead of SAS SQL or functions or SAS data. There is now way that you can use your SAS dataset in Pass-Through.

 

Your method to approach depends on what your trying to achieve.

1) Create a table in DBMS using temp table in SAS (Table in WORK Library) and DBMS table.

If this is your goal then the best approach is send the SAS temp table to DBMS temp and then do joins( @SASKiwi and @kiranv_ already gave you approach).

2) Create a table in SAS using SAS temp table and oracle table (not very large oracle table).

This will be a heterogeneous join, SAS will bring the records from DBMS to SAS environment and then do joins in SAS. This approach will be feasible if your oracle table is not very large ( fetch records are less).

options sastrace=',,,d' sastraceloc=saslog;  Using this option you can see how the sql is passed to DBMS and how many records are fetching.

 

 

LIBNAME ORC oracle user= password= path= ;
options sastrace=',,,d' sastraceloc=saslog;
proc sql;
create table sas_Table as 
select a.* 
	from orc.oracle_Table a
	inner join work.sas_temp b
	on (a.id=b.id);
quit;

3) If your oracle table is very large and want to create a table in SAS.

Follow the first approach

 

 

 

Thanks,
Suryakiran

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 17 replies
  • 5435 views
  • 0 likes
  • 6 in conversation