Variable Names Don't Begin With the Same Characters? No Problem: How to Create Variable List Without Copying, Pasting or Excel Intervention

Source: SAS Institute

Favorite

Free registration required

Working with hundreds even thousands of variables is very common for many SAS programmers. As such, SAS has provided variable list tools like VAR1-VARN or VAR: so that one does not need to type variable names one by one. However, when the variable names do not begin with the same character string, a.k.a. prefix, the SAS default variable list will not work. This paper demonstrates a dynamic yet simple time-saver to generate variable lists when variable names have other commonalities than prefixes using PROC SQL SELECT INTO with DICTIONARY.COLUMNS table. This powerful and innovative method also enables the creation of new variable names, renaming of variables, and identification of common variables without copying, pasting or Excel intervention.
Format:PDF Size:146.50
Date:Feb 2009