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 (August 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 1 Aug 2002 10:23:22 -0400
Reply-To:   "John J Genzano, III" <jgenzano@GENZANO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "John J Genzano, III" <jgenzano@GENZANO.COM>
Subject:   Re: PROC SUMMARY
In-Reply-To:   <FA0431E7B94BCF4196CE1D5334CB2F53010FA9DC@dcaamemx4.dcaa.mil>
Content-Type:   text/plain; charset="us-ascii"

The name after the statistic is the name of the variable in the output data set that holds that statistic for the variable in the VAR statement in the same position. So, in the code:

PROC SUMMARY DATA=oldset; VAR AMT; OUTPUT OUT=PROCSUM SUM=AMT_SUM;

The output dataset WORK.PROCSUM will have one variable named AMT_SUM that will hold the SUM statistic for the AMT variable in the oldset dataset.

John J Genzano, III Principal Consultant Genzano Software Consulting 610-517-2591 SAS Certified Professional, V6

"The right to be heard does not automatically include the right to be taken seriously." - Hubert Humphrey

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Smith, Curtis, Mr, DCAA Sent: Wednesday, July 31, 2002 5:59 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: PROC SUMMARY

Oops, Dave I think you slipped a little. On the OUTPUT statement you tell PROC SUMMARY which statistic to use with which numeric variable defined on the VAR statement. In this case, our friend would want the following:

OUTPUT OUT=PROCSUM SUM=AMT;

Not:

OUTPUT OUT=PROCSUM SUM=AMT_SUM;

Because AMT_SUM is not a variable in the input data file.

Curt

-----Original Message----- From: David L. Cassell [mailto:Cassell.David@EPAMAIL.EPA.GOV] Sent: Wednesday, July 31, 2002 2:41 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: PROC SUMMARY

mto <mto@ADMIN4.HSC.UTH.TMC.EDU> wrote [in part]: > Would someone please give me an example for a very very basic PROC > SUMMARY. I tried but it doesn't work.

But you included the log, so we could help you. Thanks.

> I'm using Windows95 (yes, it's still around) and SAS ver. 6.09.

That's not unreasonable.

> . . . . . > I can't find the SAS "HELP" option in the mainframe. No SAS HELP, > period.

Now that isn't reasonable. There has to be some SAS help somewhere! In the meantime, you can go to sas.com and get free access to the Online Docs:

http://v8doc.sas.com/sashtml/main.htm

Just register and you'll set. There are other copies of the SAS Online docs on the internet, too.

BTW, the help for PROC SUMMARY is all under PROC MEANS. They're really the same, under the hood.

> 12 @145 FUND $3. > 13 @185 BACC2 $2. > 14 @185 BACC $4. > 15 @233 AMT PD8.2 > 16 ; > . . . . > 31 PROC SUMMARY DATA=LEDG NWAY; > 32 CLASS FGRP BACC FUND; > 33 VAR FGRP BACC FUND AMT;

Now here's the real problem. You defined FGRP and BACC and FUND as character, but then you asked PROC SUMMARY to treat them as numeric. Change your VAR statement to:

VAR AMT;

> 34 OUTPUT OUT=PROCSUM; > 35 SUM + AMT;

Oops. You can only do something like line 35 here inside a data step. Not in a proc. Take that line out. And you probably want to change line 34 to something like:

OUTPUT OUT=PROCSUM SUM=AMT_SUM;

That way you'll have sums for each category.

HTH, David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician


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