PROC SQL Basics

What Is PROC SQL?

PROC SQL is the SAS implementation of Structured Query Language (SQL). SQL is a standardized language that is widely used to retrieve and update data in tables and in views that are based on those tables.
The following table compares terms that are used in data processing, SAS, and SQL.
This book uses all of these terms.
Data Processing
SAS
SQL
file
SAS data set
table or view
record
observation
row
field
variable
column
PROC SQL can often be used as an alternative to other SAS procedures or the DATA step. Use PROC SQL for tasks such as these:
  • retrieve data from and manipulate SAS tables
  • add or modify data values in a table
  • add, modify, or drop columns in a table
  • create tables and views
  • join multiple tables (when they contain columns with the same name)
  • generate reports

PROC SQL Syntax

The SQL procedure is initiated with a PROC SQL statement. You can use multiple statements within a PROC SQL step. Each statement defines a process and is executed immediately. Each statement must end with a semicolon. The SQL procedure is terminated with a QUIT statement.
Syntax, SQL procedure:
PROC SQL <options>;
statements;
QUIT;
Last updated: October 16, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.144.170