This paper is a collection of eleven tips and tricks using the SAS® SQL procedure. It is intended for an intermediate SAS user who would like to take a peek under the hood. The code has the same section organization as this paper, and an interested person can get that code and read this paper while executing the code.
Topics covered are:
- the SAS® data engine;
- indexing;
- the optimizer;
- correlated and uncorrelated sub-queries;
- placement of sub-queries in SQL syntax;
- views;
- fuzzy merging;
- coalescing;
- finding duplicates using SQL;
- reflexive joins;
- using SQL dictionary tables and a macro to document SAS tables.
The eleventh section adds some small tweaks to Vince DelGobbo’s excellent work on how to create a hyperlinked Microsoft Excel workbook. The appendix contains miscellaneous examples of SQL from which a reader can "steal".