How to get the total record count for any data using SAS® Enterprise Guide®


If you need to get the total record count for RDBMS or DBMS data such as Oracle, Informix, Teradata, etc., the follow code examples can be used.

This example is for any type of data:

   libname libref /*your-data-location-here */;
   proc sql;
      select count(*) from libref.table;
   quit;


This example uses SQL pass-through specifically for ODBC:

   proc sql;
      connect to odbc(dsn=xxx);
      select * from connection to odbc(select count(*) from table);
   quit;