BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
Hi any one can differentiate points wise between libname statement and pass thru query
2 REPLIES 2
jimbarbour
Meteorite | Level 14

Implicit:  You code in SAS syntax, SAS formats a query for you in the database's syntax and passes that query to the database.  Some processing will be done within the database but SAS could also do some processing of the results set.

 

Explicit:  You code in the database's syntax.  SAS passes the query directly to the database for execution without modification.  There is 100% execution of the query within the database (unless you code something in addition to what is passed to the database).

 

Jim

ChrisNZ
Tourmaline | Level 20

That's a badly worded question.

Libnames can be used for explicit and for implicit SQL. Explicit simply means that SAS does not translate the SQL to native database SQL. Instead the SQL is explicitly supplied by the user.

Consider:

libname ORA oracle connections parameters ...;
proc sql;
  connect using ORA;
  select * from connection to ORA (
    select COL1
         , listagg(COL2, ', ') within group (order by COL2) "names"
    from TABLE1
    group by COL1
  )
  order by put(COL1,myfmt.);

Here the SAS code is in blue and the Oracle code in red.

 

You could have SAS code only (though of course there would only be SAS syntax then).

libname ORA oracle connections parameters ...;
proc sql;
  select ...

  from ORA.TABLE1
  group by ...
  order by put(COL1,myfmt.);

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 4447 views
  • 3 likes
  • 3 in conversation