PROC SQL by Example: Using SQL within SAS Reviews

"PROC SQL by Example: Using SQL within SAS will appeal especially to those who have some experience with SAS DATA step programming and procedures, and who now have an interest in moving into SQL database programming. The author illustrates how SAS DATA steps and procedures translate into SQL syntax. More important, he also helps the reader understand how SQL programs embody logical constructs as opposed to procedural steps. Discussions of DATA step and SAS SQL programs build on actual programs that a reader can execute and modify. Perhaps for this reason, the text and examples achieve a level of precision and integrity that one rarely finds in a "how to by example" text. Notable extra features include discussions of SAS SQL options, set operators, using PROC SQL as a report generator (as an alternative to PROC REPORT or PROC TABULATE), SAS MACRO scripting, "pivoting" data structures using PROC TRANSPOSE, and data set persistence versus replacement.

This book takes the programming cookbook genre to a new level of excellence. "

Sigurd W. Hermansen

"This exceptionally readable book will allow SQL programmers at all levels to enhance and expand their skills with this very versatile Base SAS procedure. Howard Schreier's approach of providing DATA step methods followed by SQL techniques to accomplish the same result is a very effective teaching technique, particularly for SAS programmers comfortable with the DATA step who want to add PROC SQL to their data management and reporting toolbox. The writing style is clear and concise, and the overall organization of the book is very logical and easy to follow. An exceptional feature of this book is the way that the explanation of each example provides insight into how PROC SQL "thinks," making the use of this procedure more intuitive for beginners and experienced users alike. In particular, the chapters on joins and subqueries, as well as the one on using the Macro Facility with PROC SQL, are wonderfully comprehensive and will provide a reference that you will turn to again and again."

Christianna Williams, PhD
Senior Associate
Abt Associates Inc.

"PROC SQL by Example: Using SQL within SAS is an excellent introduction and reference manual for users looking to learn or brush up on their PROC SQL skills. The book does a great job of comparing SAS procedures to their PROC SQL counterparts. Using multiple examples, the book enables readers to easily follow along and grasp the knowledge needed to effectively enhance their SAS skills to tackle complex and new problems that might have been overwhelming before.

The key concepts of joining data are laid out and presented in a straightforward and easy-to-understand manner. Having this base knowledge is invaluable, as it allows readers to expand their knowledge of SQL, the foundation and core of the topic. The use of indexes and macros within PROC SQL also arms readers with tools to gain efficiencies and harness the additional powers of SAS.

Overall, PROC SQL by Example is a great introduction to the topic and will benefit those looking to make the jump forward."

Faisal Dosani
Senior Information Analyst

"This book has some great tips I will be putting to use! I've been programming with SAS and SQL for years, and this book is a really informative resource. I think learning by example is a thorough and efficient way to understand SAS techniques. The book has examples that you can pick up and use right away. I particularly enjoyed the comparisons between the Base SAS code and the PROC SQL code. It is a great bridge for SAS programmers to easily pick up this new language."

Candice Miller
Research Programmer
RAND Corporation

"With a title like PROC SQL by Example: Using SQL within SAS, the author makes sure that the content of the text does exactly that for the reader. Howard Schreier has provided an abundance of clear, well-designed examples that detail the spectrum of SQL topics.

The early chapters provide the reader with the appropriate SQL terminology with references to parallel Base SAS terms and concepts. Basic code and execution details are explained. Contrasts between SQL joins and DATA step merges are discussed at length. Most SQL examples are accompanied by companion DATA step or procedural examples. These comparisons are used to show the advantages of SQL capabilities over non-SQL SAS, as well as to identify any shortcomings of SQL where the non-SQL SAS solution might be more favorable. But the author points out that many solutions are equally efficient, whether programmed with SQL or Base SAS, so the solution chosen by the programmer might be based on personal coding preferences.

Later chapters examine the advantages of using SQL for tasks such as creating macro variables, accessing and altering metadata, creating and using SAS views, and mixing SQL and non-SQL SAS code to complete a task. During the discussions on these features, the author has maintained easy-to-follow examples that often build upon previous examples presented in the text.

Although this book is sold as a guide to SQL programming, SAS users might find themselves learning a few things about DATA step programming as well."

Stuart Long
Senior Systems Analyst

Back to Top