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 (March 1996, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 26 Mar 1996 00:48:00 EDT
Reply-To:   "Chen, Xi" <xic@UTKVX.UTK.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   "Chen, Xi" <xic@UTKVX.UTK.EDU>
Organization:   University of Tennessee
Subject:   Re: Q: Extracting macro parameters

I think you may think about doing the following:

1. Run Proc Contents and save the output to a data set. Then, all the variable name is under a column, and assume that the column name is named COLNAME, the data set is named ONE. 2. data two; set one; if (using scan function to select all the records in which the value of COLNAME contains "var"); call symput('v'||left(_n_),colname); run;

You will get what you want. Hope it helps.

Chen Xi

In article <3156789C.7CF7@marketresponse.nl>, Jon Webb <j.webb@marketresponse.nl> writes... >In macro-language, I want to break a series of variables into seperate variables. Also, I want to >know the number of variables. I have managed to do so with space-seperated variables, but have >problems with dealing with the dash-symbol. > >This is what I want: > >input: var8-var11 var18 var20-var21 >result: %let v1 = var8; %let v2 = var9; ... ; %let v6 = var20; %let v7 = var21; %let nrvar = 7; > >Has anyone already written a macro-utility like that? > >Eric Hoogenboom.


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