Database Reference
In-Depth Information
10.4 A Simple Explanation of SQL “PASS-THROUGH” Processing
SQL “PASS-THROUGH” processing usually involves sending commands from one version of SQL to
another for execution. Just because there is a Structured Query Language Standard that each
implementation of “SQL” follows, that does not mean that all SQL versions are the same. The SAS version
of SQL has some features that do not adhere strictly to the standard. This is the same for other versions of
SQL like Oracle, IBM, MySQL, and many others. Because SQL is designed to be a standardized language,
it was necessary to implement a method of bridging the gap between what one language can understand and
the language version of SQL that is used to access data stored on a specific computer. This method is called
the “PASS-THROUGH” processing. It allows a SAS user to pass commands that are specific to Oracle to
a computer storing data in an Oracle database, even if the commands would not have the correct syntax if
executed as a SAS SQL command.
10.5 Overview of the Examples
10.5.1 List of Examples
Table 10.5.1: List of Examples for Using PROC SQL.
Example Number
General Description
10.1
LIBNAME Assignments to Access Excel Using PROC SQL. This
example shows how to code a LIBNAME statement when using PROC
SQL with SAS 9.4.
10.2
Create an Excel File, Read It with SQL, and Then Compare the
Files. This example creates an Excel file, reads the file using SAS
PROC SQL, and compares the files.
10.3
Use PROC SQL to Read a Subset of Records from an Excel
Workbook. This example uses a SAS WHERE clause to read a subset
of the records from an Excel worksheet.
10.4
Use PROC SQL Pass-Through Facilities to Process an Excel
File. This example uses a pass-through connection to send commands
to a different SQL version. Here, PROC SQL is sending commands to
Microsoft SQL to get data from the Excel worksheet.
10.5
Read a Pre-defined Range of Cells from an Excel Workbook.
10.6
Calculate a New Variable within the SQL Code and Sort the
Output.
10.7
Examine the Contents and Structure of an Excel Workbook with a
“PCFILES::” Special Query.
10.6 Examples
Example 10.1 LIBNAME Assignments to Access Excel Using PROC SQL
The code in Figure 10.3 shows the LIBNAME construct available when using PROC SQL for the three
Excel formats that can be used as input and then output with PROC SQL in SAS 9.4. The macro version of
Excel files (*.xlsm) is not supported, and older versions of SAS may support only some of these
configurations.
 
 
Search WWH ::




Custom Search