[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: PROC SUMMARY
From:       "Smith, Curtis, Mr, DCAA" <Curtis.Smith () DCAA ! MIL>
Date:       2002-07-31 21:58:55
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic