Output 1.2 Sample DATA Step Output
This example shows that PROC SQL can achieve the same results as Base SAS software
but often with fewer and shorter statements. The SELECT statement that is shown in this
example performs summation, grouping, sorting, and row selection. It also displays the
query's results without the PRINT procedure.
PROC SQL executes without using the RUN statement. After you invoke PROC SQL
you can submit additional SQL procedure statements without submitting the PROC
statement again. Use the QUIT statement to terminate the procedure.
Notes about the Example Tables
For all examples, the following global statement is in effect:
libname sql 'SAS-library';
The tables that are used in the whole section of “Using the SQL Procedure” contain
geographic and demographic data. The data is intended to be used for the PROC SQL
code examples only. The data is not necessarily up-to-date or accurate.
These tables are available in a ZIP file at http://support.sas.com/documentation/
onlinedoc/base/index.html. Look for SAS SQL Procedure User’s Guide on this page.
Download and extract the ZIP file to a location that is accessible by SAS. The extracted
ZIP file is a transport file that contains the tables.
Start SAS. Submit this code to import the tables:
/* Substitute the pathname of your Sasuser
directory for 'your-Sasuser-directory-path'
and the appropriate pathname and filename
for 'your-downloaded-file-location' */
libname new 'your-Sasuser-directory-path';
filename trans 'your-downloaded-file-location';
Notes about the Example Tables 7