As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

SQL procedure

From sasCommunity
Jump to: navigation, search

Within SAS, the SQL procedure is used to run SQL queries on data set(s) or database(s). The differences between PROC SQL and the DATA Step and advantages of each have been discussed in various papers; see PROC SQL vs. DATA Step.


   proc sql <options>;
       <SQL statement(s)>

Multiple SQL queries may be run from the same PROC SQL step.

There are many uses of the SQL procedure, including creating, modifying,[1] and joining data sets. To delve into some of the examples of what you can do, see the pages in the SQL Procedure category.

PROC SQL options

Optional <options> that may be passed at the beginning of a PROC SQL step include inobs= and outobs= to limit the number of observations read in or output, NOPRINT to suppress printing results in a report, respectively, and feedback to write more information to the log, method to change how PROC SQL operates. A more comprehensive list is available here.

Further reading

Introductory papers and articles

SAS Documentation and publications


Wiki articles on specific topics

Blogs and other websites