Tracing and Evaluating SQL Generation

SAS provides a tracing facility that you can use to review the SQL code that SAS generates and passes to the DBMS. Specify the SASTRACE= option, as shown in this example for Netezza, to display the generated SQL to the SAS log.

options sastrace=',,,d' sastraceloc=saslog nostsuffix msglevel=i;
libname mydb netezza server='myserver.com' database=mydbms user=myuser
   password=mypwd;

proc sql;
  select count(*) from mydb.class;
quit;

This code generates a query to a Netezza database:

select COUNT(*) from MYDBMS..class TXT_1

For more information, see SASTRACE= SAS System Option.

Last updated: February 3, 2026