hi all,
Can anyone please explain to me the advantage of the one over the other or any good article i can read about this?
If i use the 1st i know i can link all the oracle tables to SAS and play with them(update,join,....) and then save them back in Oracle. The 2nd one is kinda annoying to me but i ve seen many times ppl use it more then the 1st one.Why? Memory-wise,CPU wise?
Thanks,
In my view, one of the advantages of using pass-through is that you can be sure that the code, table joins, etc is processed by the DBMS engine.
With libname access, SAS may not be able to pass the code to the DBMS for processing. As a result, expensive table joins may be passed in their entirety back to SAS to handle -- which increases network traffic, table sizes, processing time, etc.
However, libname method can be much easier to work with since you can dispense with having to use DBMS-specific code.
If joins and code are fairly straightforward, and I am fairly confident that SAS will pass the query to the DBMS for processing, then I will use the libname method.
Otherwise, I use pass-through.
In my view, one of the advantages of using pass-through is that you can be sure that the code, table joins, etc is processed by the DBMS engine.
With libname access, SAS may not be able to pass the code to the DBMS for processing. As a result, expensive table joins may be passed in their entirety back to SAS to handle -- which increases network traffic, table sizes, processing time, etc.
However, libname method can be much easier to work with since you can dispense with having to use DBMS-specific code.
If joins and code are fairly straightforward, and I am fairly confident that SAS will pass the query to the DBMS for processing, then I will use the libname method.
Otherwise, I use pass-through.
Thanks for the nice explanation Fugue.
So if i have lets say 2M - 8M record tables i should use pass through ,huh even though the joins are quite straightforward ?
I'd be inclined to agree with you as a general rule -- explicit PROC SQL pass-through would be the superior choice in that case.
In my experience I've found Oracle more fiddly to tune well compared to other databases such as SQL Server. In which case PROC SQL pass-through gives you better control to do things like Oracle hints for parallelisation for example.
Also dont forget other SAS options for tuning database queries. My favourite is READBUFF = this can have a huge impact on query performance, and they work equally well for LIBNAME and pass-through.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.