LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2005, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 31 Oct 2005 14:17:47 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: PROC SQL
Comments: To: csrna@FORD.COM
In-Reply-To:  <A3D5552AD7F7BB4A978B8B4A376775F50649DA5C@na1ecm60.dearborn.ford.com>
Content-Type: text/plain; format=flowed

Carol,

When creating summary vars in SQL and you dont give the summary var a name it will use a temporary name such as _temp001 etc...., simply go back to your select statement and where you have: sum(GBS)

put sum(GBS) as SumOfGBS

Now when you look at your output you will see

DSN GBS SumOfGBS

Toby Dunn

From: "Srna, Carol (C.)" <csrna@FORD.COM> Reply-To: "Srna, Carol (C.)" <csrna@FORD.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: PROC SQL Date: Mon, 31 Oct 2005 08:14:51 -0500

Thank You, Gadi. I got wanted results. What is _TEMG001? Thanks again.

1The SAS System

Obs DSN _TEMG001 ======> what is this?

1 AABCC 40 2 CAS 24 3 JHHKK 29 4 XYZZZ 56

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Gadi Ben-Avi Sent: Monday, October 31, 2005 8:08 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: PROC SQL

Hi,

It should be: PROC SQL;

CREATE TABLE DSNS AS

SELECT DISTINCT DSN, sum(gbs) FROM TEMP1 group by dsn;

Gadi

""Srna, Carol (C.)"" <csrna@FORD.COM> wrote in message news:A3D5552AD7F7BB4A978B8B4A376775F505B8B661@na1ecm60.dearborn.ford.com ... > Hi All. What I want is to sum the GBS everytime the DSN variable > changes. What I have is incorrect and I am not sure how to correct > the error. > "ERROR: Invalid option name GBS." > I am researching. > Thanks for all you help. > ~~Carol > > =20 > DATA TEMP; =20 > RETAIN GBS; =20 > INPUT DSN $ 8-12 GBS 17-18; =20 > CARDS; =20 > CAS 23 =20 > CAS 1 =20 > AABCC 40 =20 > XYZZZ 23 =20 > XYZZZ 33 =20 > JHHKK 14 =20 > JHHKK 15 =20 > ; =20 > RUN; =20 > =20 > PROC SORT DATA=3DTEMP OUT=3DTEMP1; =20 > BY DSN; =20 > RUN; =20 > =20 > PROC SQL; =20 > CREATE TABLE DSNS AS =20 > SELECT DISTINCT GBS,DSN FROM TEMP1,=20 > SUM(GBS); =20 > QUIT; =20 > =20


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