|Date: ||Mon, 19 Oct 2009 21:54:20 -0400|
|Reply-To: ||Sigurd Hermansen <HERMANS1@WESTAT.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Sigurd Hermansen <HERMANS1@WESTAT.COM>|
|Subject: ||Re: Generating line of variable names|
|Content-Type: ||text/plain; charset="us-ascii"|
If you go way back in the excellent SAS-L archives you will find a SAS Macro that I wrote, very similar to SAS Macros that others have written, that selects SAS variable names from DICTIONARY.columns into a comma-delimited list and assigns the list to a SAS macrovariable that will expand in a SAS program. More recently I've tended to use the SAS data option DELETE when I have to subset a large and cumbersome list of variables.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Andrew Clapson
Sent: Friday, October 16, 2009 3:46 PM
Subject: Generating line of variable names
In the process of sifting through variables in a data set I'm working on
- one for which someone decided to use rather cumbersome variable names
- I thought how much easier it would be to simply paste a spaced line of
the different variable names, and then just delete the ones that I want
to drop (or keep, as the case may be).
Is there any way to get SAS to print a line of variable names for a
Some variant of a PROC CONTENTS perhaps?
Even better would be assigning this process to a function key (via a
recorded macro, maybe?), to print the full list of variables at a
keystroke for a KEEP, DROP, or RETAIN command.