Date: Thu, 14 Sep 2006 19:43:23 -0700
Reply-To: Dale Remus <hellangel_987@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale Remus <hellangel_987@YAHOO.COM>
Subject: Re: Extract variable names
Content-Type: text/plain; charset=iso-8859-1
I have a relevant question,
After extracting the names of variables, and keep them
into a Macro, how do I know that how many names have
> Reply-To: "Terjeson, Mark"
> Sender: "SAS(r) Discussion"
> From: "Terjeson, Mark"
> Subject: Re: Extract variable names
> Hi Drew,
> Here is a fairly common way. For libraries
> that you have open (i.e. LIBNAME) the view
> sashelp.vcolumn will have the names of all
> the datasets in all the open libraries. Of
> course you can use a datastep to fetch them
> as well and then output with call symput().
> * create sample ;
> data mydata;
> set sashelp.class;
> proc sql noprint;
> select name into :mvar separated by ','
> from sashelp.vcolumn
> where libname eq 'WORK'
> and memname eq 'MYDATA';
> %put mvar is >&mvar<;
> Hope this is helpful.
> Mark Terjeson
> Senior Programmer Analyst, IM&R
> Russell Investment Group
> Global Leaders in Multi-Manager Investing
>> -----Original Message-----
>> From: SAS(r) Discussion
>> Subject: Extract variable names
>> My data set has many variables. I'd like to extract
>> the names of these
>> variables, and put them into a Macro variable, say
>> "name". The resutant
>> should look like as if it is from
>> Can you kindly show me the way to it?
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around