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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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
  • 2 replies
  • 3881 views
  • 3 likes
  • 3 in conversation