SAS SQL
A major reason for SAS' staying power is the tight integration of SQL into its data model.
Contents
Basic Usage
SQL is called from a procedure. SQL grammar is emulated by SAS, with several enhancements. Chief among these being first-class access to SAS libraries and tables.
proc sql;
create table LIBREF.NEWTABLE as
select VARLIST
from LIBREF.OLDTABLE;
run;
SAS Dialect of SQL
SAS functions, such as year(), are available within SQL procedures.
The select command is extended with SAS formatting.
proc sql;
select Birthdate format=mmddyy10., year(Birthdate) as Birthyear
from LIBREF.TABLE;
run;