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 (July 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 19 Jul 2006 11:02:18 -0400
Reply-To:   Sophie <sophiestat@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Sophie <sophiestat@GMAIL.COM>
Subject:   Re: Group by **** with cube
Comments:   To: toby dunn <tobydunn@hotmail.com>
In-Reply-To:   <BAY101-F19418BD28F3CE2D3FCAEFBDE600@phx.gbl>
Content-Type:   text/plain; charset=ISO-8859-1; format=flowed

Hi, you did not mention what total you want and I don't know SQL. If you want the summation of cube by ETG_FAMILY. you could try:

Proc SQL ; Create Table out.iptotal As Select *, sum(cube) From out.ip_final Group By ETG_FAMILY; Quit ;

Good luck

Sophie

On 7/19/06, toby dunn <tobydunn@hotmail.com> wrote: > > Irin , > > I am by far not a SQL expert but I dont recall any two software packages > versions of SQL being the same. Heck I dont know of one full ansi version > of SQL. > > In SAS SQL version there is no 'with' clause in the group by statement. > > Try: > > Proc SQL ; > Create Table out.iptotal As > Select * > From out.ip_final > Group By ETG_FAMILY , cube ; > Quit ; > > > Toby Dunn > > > > > > From: Irin later <irinfigvam@YAHOO.COM> > Reply-To: Irin later <irinfigvam@YAHOO.COM> > To: SAS-L@LISTSERV.UGA.EDU > Subject: Group by **** with cube > Date: Wed, 19 Jul 2006 07:41:44 -0700 > > I run the following code and got an error log: > > Create Table out.iptotal As > 107 Select * > 108 From out.ip_final > 109 Group By ETG_FAMILY with cube; > ____ > ____ > ____ > 22 > 22 > 22 > 76 > 76 > 76 > ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, > (, *, **, +, ',', -, '.', /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, > CONTAINS, > EQ, EQT, EXCEPT, GE, GET, GT, GTT, HAVING, IN, INTERSECT, IS, LE, LET, > LIKE, > LT, LTT, NE, NET, NOT, > ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, > (, *, **, +, ',', -, '.', /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, > CONTAINS, > EQ, EQT, EXCEPT, GE, GET, GT, GTT, HAVING, IN, INTERSECT, IS, LE, LET, > LIKE, > LT, LTT, NE, NET, NOT, > ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, > (, *, **, +, ',', -, '.', /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, > CONTAINS, > EQ, EQT, EXCEPT, GE, GET, GT, GTT, HAVING, IN, INTERSECT, IS, LE, LET, > LIKE, > LT, LTT, NE, NET, NOT, > NOTIN, OR, ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=. > NOTIN, OR, ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=. > NOTIN, OR, ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=. > > ERROR 76-322: Syntax error, statement will be ignored. > ERROR 76-322: Syntax error, statement will be ignored. > ERROR 76-322: Syntax error, statement will be ignored. > > > > It makes me think that WITH CUBE option does not work in SAS proc sql > while it works in ORACLE SQL PLUS. > How can I calculate total instead? > > Thank you in advance, > > Irin > > > > --------------------------------- > Do you Yahoo!? > Next-gen email? Have it all with the all-new Yahoo! Mail Beta. >


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