PROC SQL: Beyond the Basics Using SAS®, Third Edition

I always learn a lot from Kirk, and his latest book, the third edition of PROC SQL: Beyond the Basics Using SAS, did not let me down.  I love his catchy saying to remember the order in which SQL statements should be specified: “SQL Is Fun When Geeks Help Others”.  There were so many new things that I learned from this book. It will definitely be my go-to book for all things PROC SQL! 

Richann Jean Watson
Statistical Programmer and CDISC Consultant


Kirk Paul Lafler’s PROC SQL: Beyond the Basics Using SAS®, Third Edition, delivers the most comprehensive examination and explanation of the SAS SQL procedure to date. With a gentle introduction to data structures, Kirk lays a broad, software-agnostic foundation that encompasses referential integrity, primary and foreign keys, integrity constraints, database normal forms, and other aspects of relational database theory. The text further introduces not only SAS SQL but also ANSI SQL, defining and expertly contrasting their similarities and differences, making this the perfect primer for the SAS practitioner having no SQL background.

Having laid this groundwork, Kirk leaves no stone unturned in fully exploring the functionality and syntax of the SQL procedure. The text shows SAS practitioners not only the “SQL way” of extracting, cleaning, transforming, and reporting data, but also functionally equivalent DATA steps that should be considered. In so doing, Kirk highlights query and subquery performance and optimization and conveys best practices that developers and analysts can adopt and carry throughout their careers. If you are preparing for the SAS Certified Advanced Programmer exam or are dedicated to taking your SAS software skills to the next level, this book is for you.

Troy Martin Hughes
SAS-Wiley Author


Kirk Lafler’s third edition of PROC SQL: Beyond the Basics Using SAS continues to deliver essential syntax and enhanced approaches to SQL programming that are useful for all levels of SAS users. When working on a project, I find myself always going to Kirk’s SQL book to help debug data joins or to refresh my SQL knowledge on fuzzy matching. My go-to chapters are “Coding Complex Queries” and “Fuzzy Matching Programming.”  As we all know, the complexities of joins are challenging at times. This is when PROC SQL: Beyond the Basics Using SAS delivers an easy-to-follow definition for many types of joins as well as explicit and comprehensive SAS coding examples. The third edition is a must for every SAS user’s desk!


MaryAnne DePesquo
Healthcare Consultant
SAS Global Forum 2019 Conference Chair


Packed with examples, detailed code, and step-by-step explanations about how the SAS SQL procedure works, this book is designed for any level of SAS programmer, from student to seasoned professional. It is especially beneficial for anyone looking to optimize their code's performance with the latest SQL techniques, as each technique is illustrated in an easy-to-follow, logic-to-implementation format. I definitely recommend this edition as a must-have for any SAS programmer's book collection!

Deanna Schreiber-Gregory
Independent Consultant - Statistical Theory and Data Management
Juxdapoze


The publication of Kirk Lafler’s book on SQL is a welcome reminder that expert SAS programming skills are important. Indeed, they are very much alive and well in the age of “data scientists.” The book’s title is accurate. Kirk presents and explains several techniques and “Beyond the Basics” does a thorough job documenting standard SQL syntax and covers all the important topics such as joins, complex queries and table management. In addition, several new topics are introduced. These include fuzzy matching and data-driven programming. Perhaps this new material could have included how SQL can be used as a method to restructure (rotate) data. A future edition of this book might also include some discussion of FedSQL.

The first chapter of the book dives into database design. That’s a novel way to introduce the subject of SQL but it makes sense. SQL isn’t an abstract method of programming. SQL has always been tied to database design, database management and data analysis. A little discussion about hierarchical databases that preceded relational ones would have been useful. Companies that used hierarchical databases found that it took new hires many months to get up to speed and work productively with them. SQL was developed to get past this bottleneck.

Kirk’s documentation puts into one easily accessible place “all you wanted to know but were afraid to ask” about SQL. It’s an important reference work and gives programmers many useful examples of how to write code. At the same time, the book could have taken a slightly more partisan approach to the subject. For example, it could have discussed how multiway joins obviate the need to do multiple sorts and merges. It could have pointed out how a subquery enables cross-referencing, a task that comes up very often in the real world.

This edition of Kirk’s book is a very valuable reference work that will help programmers understand how to make full use of the SQL procedure in SAS.

Jim Sattler, President
Satmari Software Systems, Inc


Just like a fine wine that gets better with age, it comes as no surprise that Kirk Lafler's third edition of PROC SQL: Beyond the Basics Using SAS® has also gotten better and is full of in-depth knowledge and experience. Packed with more tips and productive ideas, any new or experienced SAS programmer can quickly master the full power of PROC SQL.

I continue to depend on this book as my first choice for PROC SQL options and powerful features such as detail and summary information, queries, simple to complex joins, indexes, macro variables, metadata, and subqueries. The sample datasets and examples make these features easy to understand and apply. For more data transformations, there is a great section on data cleaning, filtering, de-duplication, and format revision.

Sunil Gupta
Director of Statistical Programming, Cytel


Just when you think you know everything about PROC SQL in SAS®, Kirk Lafler comes out with a new edition of his book, PROC SQL: Beyond the Basics Using SAS®, which is full of new and surprising ways to utilize PROC SQL.

In his usual straightforward writing style and easy-to-follow examples, Kirk knocks it out of the ball park with the third edition of PROC SQL: Beyond the Basics Using SAS®.  If you are new to programming in SAS or PROC SQL, this book has a ton of tried-and-true examples, techniques, and programming pearls of wisdom.  For advanced SAS programmers, Kirk has included new chapters on fuzzy matching and data-driven programming using PROC SQL that are sure to be a big hit. These chapters are full of advanced ways to utilize PROC SQL in your daily programming to tackle those hard programming tasks.  If you are interested in raising your skill set to the next level or want to make your code better, you need to have this book – you won't be disappointed.

Toby Dunn
SAS Programmer


Kirk Lafler continues to wow me with his style of explaining PROC SQL with the SAS community. Whether you are SAS beginner or a SAS guru, this is a must have book!

Rick Mitchell
2013 SAS Global Forum Conference Chair