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 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 25 Mar 2010 12:23:37 -0700
Reply-To:     Franco82 <franco.mendolia@GMX.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Franco82 <franco.mendolia@GMX.DE>
Organization: http://groups.google.com
Subject:      Re: PROC SQL: Concatenating values of several columns into
              several macro variables
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On Mar 24, 8:35 pm, Tom Abernathy <tom.aberna...@gmail.com> wrote: > On Mar 24, 2:48 pm, Franco82 <franco.mendo...@gmx.de> wrote: > > > > > Hello! > > > I am using a proc sql statement like the one given below, which works > > fine: > > > proc sql; > > select sum(z1),sum(z2),sum(z3) into :s1 separated by ' ', :s2 > > separated by ' ', :s3 separated by ' ' > > from dataset > > where event = 1 > > group by time; > > quit; > > > What I want is that instead of having to specify for each variable " > > separated by ' ' ", I would like to have something like > > > select sum(z1),sum(z2),sum(z3) into :s1-:s3 separated by ' ' > > > since in general I have much more than 3 variables. However, that > > statement does not work. Any ideas? > > > Thanks, > > Franco > > Someone posted a cleverly little %FOR macro for generating code like > that fairly easily. > I am curious why if you have that many values you putting them into > macro variables? Why not just put them in a dataset? > Also why are you using SQL to do the work of PROC SUMMARY?

I didn't even consider proc summary, thanks for the hint!


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