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 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 15 Dec 2010 14:40:39 -0600
Reply-To:   "Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: Variable list into a single macro variable XXXX
Comments:   To: Dan Abner <dan.abner99@gmail.com>
In-Reply-To:   <AANLkTi=X2=xjLd1zjO-iG+2+f-VTZYkTDSXYLX=U7wBp@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

Using TRANSPOSE should not be a problem. How does what you tried differ from this?

239 proc transpose data=sashelp.class(obs=0) out=varlist; 240 var name-numeric-weight name-character-weight; 241 run;

NOTE: Numeric variables in the input data set will be converted to character in the output data set. NOTE: There were 0 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.VARLIST has 5 observations and 1 variables. NOTE: PROCEDURE TRANSPOSE used (Total process time):

242 proc sql noprint; 243 select _name_ into :varlist separated by ' ' 244 from varlist; 245 quit; NOTE: PROCEDURE SQL used (Total process time):

246 run; 247 %put NOTE: VARLIST=&varlist; NOTE: VARLIST=Age Height Weight Name Sex

On Wed, Dec 15, 2010 at 2:05 PM, Dan Abner <dan.abner99@gmail.com> wrote: > Hello everyone, > > I have the following macro call statement: > > > %*MEANSOUT*(DATA=D1,VAR1=Y X1-X3 AGE--WEIGHT CHAR) > > Can anyone suggest the most efficient way to take the macro parameter VAR1 > and essentially transform the mixed variable specification ( a mix of list, > number range, & name range) into a simple list of all variable names > delimited by a single blank? I had written a short sequence of steps that I > thought cleverly achieved this end, but my method only works when all > variables are of the same type (due to dependence on PROC TRANSPOSE). My > method does not work when the variables are of mixed variable type (num & > char). > > Any help is appreciated. > > Thanks! > > Dan >


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