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 (June 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 15 Jun 2007 07:41:34 -0400
Reply-To:     "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: Internet News Service
Subject:      Re: loop through string macro variable
Comments: To: sas-l@uga.edu

Dirk Nachbar wrote: > The code below creates "var x11-x21; var y11-y21; var z11-z21;"

No it doesn't. It should generate

var x11-x21; y11-y21; z11-z21;

> although it want to create "var x11-x21 y11-y21 z11-z21" (prod=10). > How to get around that. Thanks. > > proc summary data=temp; > class store week; > var %let j=1; > %do %while (%scan(&vars, &j, %str( ))> ); > %let var=%scan(&vars, &j, %str( )); > &var.11-&var.%eval(10+&prod); > %let j=%eval(&j+1); > %end; > output out=tupcdata (where=(_type_=3)) sum= ; > run; > > Dirk

remove the semi colon from

> &var.11-&var.%eval(10+&prod);

&var.11-&var.%eval(10+&prod)

Place a bare semicolon after the %end; to generate VAR statement terminus

;

-- Richard A. DeVenezia http://www.devenezia.com/


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