Overview

Introduction

The SELECT statement is the primary tool of PROC SQL. Using the SELECT statement, you can identify, manipulate, and retrieve columns of data from one or more tables and views.
You should already know how to create basic PROC SQL queries by using the SELECT statement and most of its subordinate clauses. To build on your existing skills, this chapter presents a variety of useful query techniques, such as the use of subqueries to subset data.
The PROC SQL query shown below illustrates some of the new query techniques:
proc sql outobs=20; title 'Job Groups with Average Salary'; title2 '> Company Average'; select jobcode, avg(salary) as AvgSalary format=dollar11.2, count(*) as Count from sasuser.payrollmaster group by jobcode ...

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.