01-22-2013 01:12 PM
Does anyone know what happens behind the scenes with SAS/Access connections to Teradata via a LIBNAME statement?
For example, consider this code block:
libname TDATA teradata user=xxx password=xxx server='myserver' database='MYDB';
The question is: how many database connections are made? Does SAS understand this as a UNION operation and convert it as such using one connection, or does it make three separate database connections? If so, then what about SAS MERGE operations, or syntax like this:
I'm asking because our environment is going to enforce a new rule that no more that five concurrent sessions are allowed per user ID. I need to understand how sessions are allocated in SAS so we can review our code and advise our users of this change.
01-22-2013 03:25 PM
I don't have the answer, but one way to find it out quick and easy is to check with your Teradata DBA, after running your test code, just ask for the log or let DBA check it for you.
01-23-2013 05:06 AM
About what SAS actually sends down to the database is fairly documented for each Access engine.
For SAS datasteps, I think that WHERE, BY and pehaps KEEP/DROP dataset options are sent to the source. The rest of the data step syntax differ so much from SQL, so it would be quite cumbersome to translate to Teradata SQL.
So in your case, I don't think SAS will let Teradata know that there is UNION kind of thing going on, it will trigger two table scans, stream the result sequentially to the data step, which handles the processing.
To actually see what is sent to Teradata, use the SASTRACE options.
01-23-2013 02:14 PM
Check the SAS/ACCESS documentation for Teradata (V 9.3 here):
There are options for using more than one database connection simultaneously to speed up queries - generally for loading data, but you can set the minimum and maximum connections allowed: