Help using Base SAS procedures

libname vs pass through

Accepted Solution Solved
Reply
Super Contributor
Super Contributor
Posts: 440
Accepted Solution

libname vs pass through

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,


Accepted Solutions
Solution
‎06-16-2014 09:25 PM
Super Contributor
Posts: 307

Re: libname vs 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.

View solution in original post


All Replies
Solution
‎06-16-2014 09:25 PM
Super Contributor
Posts: 307

Re: libname vs 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.

Super Contributor
Super Contributor
Posts: 440

Re: libname vs 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 ?

Super Contributor
Posts: 307

Re: libname vs pass through

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.

Super User
Posts: 3,100

Re: libname vs pass through

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. 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 263 views
  • 2 likes
  • 3 in conversation