LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 20 Dec 2007 07:23:54 -0800
Reply-To:     karma <dorjetarap@GOOGLEMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         karma <dorjetarap@GOOGLEMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: assigning column variable to macro variable
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On Dec 20, 2:02 pm, Chris.Bro...@ONS.GOV.UK (Chris Brooks) wrote: > Try this macro > > %%macro vname; > %let dsid=%sysfunc(open(sashelp.class,i)); > > %do i=1 %to %sysfunc(attrn(&dsid,nvars)); > %global var&i; > %let var&i=%sysfunc(varname(&dsid,&i)); > %end; > %let rc=%sysfunc(close(&dsid)); > %mend; > %vname; > > Chris > > Chris Brooks > SAS Technical Lead > Office for National Statistics > United Kingdom > > On Thu, 20 Dec 2007 05:35:58 -0800, karma <dorjeta...@GOOGLEMAIL.COM> > wrote: > > > > >Hi, > > >I want to know if there is a way to make a column variable a global > >variable. > > >The following doesn't work > > >data _null_; > > set test; > > %global var1; > > %let var1=variableOne; > >run; > > >This makes var1 resolve to the text variableOne, rather than the value > >in column variableOne. Any suggestions? > > >Thanks- Hide quoted text - > > - Show quoted text -

Hi Chris,

Can you please explain what this macro does? It looks like it creates global variables for all column values?

Cheers


Back to: Top of message | Previous page | Main SAS-L page