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 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 18 Mar 2009 12:09:25 -0700
Reply-To:     jain.vineet.i@GMAIL.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         jain.vineet.i@GMAIL.COM
Organization: http://groups.google.com
Subject:      parsing delimited string to variables
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

I am trying to parse a delimited string into variables. I do not know how many values are there in the string. e.g. tempDimensionName= Measure1* Measure2* Measure3* Measure4* Measure5...Measure<n> DimensionCount = Occurances of '*' in the above string I want to get: Variable1=Measure1 Variable2=Measure2 ... Variable<n>=Measure<n> This is what I wrote which is of course wrong.

Data _NULL_ ; %LET Y = 0; %Global Looping; %LET Looping = %EVAL(&DimensionCount+1) ; DO I = 1 TO &Looping BY 1; %LET y = %eval(&y +1); %Let Xt = %SCAN(&tempDimensionName,&Y,*) ; CALL SYMPUT (RESOLVE('Variable')||left(I), &Xt); END; run;

A little help in writing an efficient code for this is greatly appreciated.

Thanks,

Vineet.


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