Skip to content

Latest commit

 

History

History

3254-2019-Lavery

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Cool SQL Tricks

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:

  1. the SAS® data engine;
  2. indexing;
  3. the optimizer;
  4. correlated and uncorrelated sub-queries;
  5. placement of sub-queries in SQL syntax;
  6. views;
  7. fuzzy merging;
  8. coalescing;
  9. finding duplicates using SQL;
  10. reflexive joins;
  11. 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".