Date: Fri, 27 Jan 2012 13:01:32 +0000
Reply-To: "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Subject: Re: Macro Related - Interview Question
In-Reply-To: <000301ccdc98$bf6e2c30$3e4a8490$@net>
Content-Type: text/plain; charset="us-ascii"
> From: B & E Zimmerman
> Sent: Thursday, January 26, 2012 9:10 PM
> To: 'SAS(r) Discussion'
> Subject: Macro Related - Interview Question
>
> Listers:
>
> I went on a job interview this morning and the hiring manager asked the
> following question: how would you convert the column variable names into
> macro variables for a SAS data set?
>
> I stumbled around mentioning something about dictionary columns but I'd
> actually like to know the answer or be pointed to it.
>
> TIA
>
> Bernie Zimmerman
> Lurker
http://www.sascommunity.org/wiki/Making_Lists
the most efficient method is
proc contents
sashelp.vcolumns requires an update of sql dictionary tables
so it is an order of magnitude slower
and therefore, deprecated,
than
proc sql; select ... into :name1 - name&SysMax
from dictionary.columns
hmmm forgot the name of that macro variable
the name is in the paper
List Processing Basics Creating and Using Lists of Macro Variables
Tiny Url: http://tinyurl.com/5p3j2z for this page
http://www.sascommunity.org/wiki/List_Processing_Basics_Creating_and_Using_Lists_of_Macro_Variables
http://tinyurl.com/6mmqpj for paper
http://www2.sas.com/proceedings/forum2007/113-2007.pdf
hth
Ron Fehd list-processing maven