Date: Thu, 27 May 1999 16:40:23 PDT
Reply-To: jsm Mazuch <j_mazuch@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: jsm Mazuch <j_mazuch@HOTMAIL.COM>
Subject: a single question.
Content-type: text/plain; format=flowed;
Dear all,
I have a sas dataset in this format:
I CODIGO QTD PRECO
1 b 10 10
1 a 10 5
1 c 30 2
1 b 10 10
1 a 12 5
2 c 56 1
2 a 12 5
2 a 10 5
2 c 18 1
2 a 12 5
Using proc summary
proc summary data = saida;
class Codigo; var Qtd; by i;
output out=somas(keep=Codigo Soma i) sum=Soma;
run;
I get
OBS I CODIGO SOMA
1 1 112
2 1 a 10
3 1 b 10
4 1 c 92
5 2 66
6 2 a 30
7 2 c 36
Now, I want another sas dataset
I CODIGO QTD PRECO soma
1 b 10 10 112
1 a 10 5 112
1 c 30 2 112 sum by i=1
1 b 10 10 112
1 a 12 5 112
2 c 56 1 66
2 a 12 5 66
2 a 10 5 66 sum by i=2.
2
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com