Date: Thu, 8 Jun 2006 18:18:08 +0200
Reply-To: Stéphane Colas <saslist@DATAMETRIC.FR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Stéphane Colas <saslist@DATAMETRIC.FR>
Subject: Re: Data manupulation
In-Reply-To: <200606081604.k58CiTWH001222@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
proc sql noprint;
create table final as
select var, sum(value) from givendataset group by var ;
quit ;
No ?
--
Stéphane.
http://www.datametric.fr
(translated).
Selon rathindronath <mehedisas@YAHOO.COM>:
> I have adataset as follows where I have two bygroup: 1, 2 and 3. Now I have
> to add teh value of all three.
>
> Given dataset:
> --------------
>
> bygrp Var value
>
> 1 abdominal pain 10
> 1 abscess 20
> 1 accidental injury 5
> 1 asthenia 6
> 2 abdominal pain 20
> 2 abscess 10
> 2 accidental injury 5
> 2 asthenia 1
> 3 abdominal pain 0
> 3 abscess 0
> 3 accidental injury 0
> 3 asthenia 0
>
> Result:
> --------
> bygrp Var value
>
> 1 abdominal pain 30
> 1 abscess 30
> 1 accidental injury 10
> 1 asthenia 7
>
>
> Thanks
>
|