Interfaces with the SQL Procedure
Using PROC SQL
Structured Query Language (SQL) is a standardized, widely used language for retrieving
and updating data in databases and relational tables. SAS software's SQL processor
enables you to do the following:
create tables and views
retrieve data stored in tables
retrieve data stored in SQL and SAS/ACCESS views
add or modify values in tables
add or modify values in SQL and SAS/ACCESS views
INTO Clause
SQL provides the INTO clause in the SELECT statement for creating SAS macro
variables. You can create multiple macro variables with a single INTO clause. The INTO
clause follows the same scoping rules as the %LET statement. For a summary of how
macro variables are created, see Chapter 3, “Macro Variables,” on page 23. For more
information and examples relating to the INTO clause, see “INTO Clause” on page 297.
Controlling Job Execution
PROC SQL also provides macro tools to do the following:
stop execution of a job if an error occurs
execute programs conditionally based on data values
The following table provides information about macro variables created by SQL that
affect job execution.
Table 8.2 Macro Variables That Affect Job Execution
Macro Variable Description
SQLEXITCODE Contains the highest return code that occurred from some types of
SQL insert failures. This return code is written to the SYSERR
macro variable when PROC SQL terminates.
SQLOBS Contains the number of rows or observations produced by a
SELECT statement.
SQLOOPS Contains the number of iterations that the inner loop of PROC
SQL processes.
SQLRC Contains the return code from an SQL statement. For return
codes, see SAS SQL documentation.
Interfaces with the SQL Procedure 109
..................Content has been hidden....................

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