By default, processing
is passed to the DBMS whenever possible, because the database might
be able to process the functionality more efficiently than SAS does.
In some instances, however, you might not want the DBMS to process
the SQL. For example, the presence of null values in the DBMS data
might cause different results depending on whether the processing
takes place in SAS or in the DBMS. If you do not want the DBMS to
handle the SQL, use DIRECT_SQL= to force SAS to handle some or all
SQL processing.
If you specify DIRECT_SQL=NOGENSQL,
PROC SQL does not generate DBMS SQL. This means that SAS functions,
joins, and DISTINCT processing that occur
within PROC
SQL are not passed to the DBMS for processing. (SAS functions
outside PROC
SQL can still be passed to the DBMS.) However, if PROC SQL contains
a WHERE clause, the WHERE clause
is passed
to the DBMS, if possible. Unless you specify DIRECT_SQL=NOWHERE, SAS
attempts to pass all WHERE clauses to the DBMS.
If you specify more
than one value for this option, separate the values with spaces and
enclose the list of values in parentheses. For example, you could
specify DIRECT_SQL=(NOFUNCTIONS, NOWHERE).
DIRECT_SQL= overrides
the SQL_FUNCTIONS= LIBNAME option. If you specify SQL_FUNCTIONS=ALL
and DIRECT_SQL=NONE, no functions are passed.