| Date: | Thu, 15 Jul 2004 13:26:21 -0400 |
| Reply-To: | "Lustig, Roger" <roger.lustig@CITIGROUP.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Lustig, Roger" <roger.lustig@CITIGROUP.COM> |
| Subject: | Re: Too easy or that can not be done? |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
Xavier:
TABULATE works, but you have to fool it a little.
data test;
input X $ Y $ a b;
cards;
A 011 10 27
A 142 44 22
B 142 29 24
C 142 18 7
;
run;
proc format;
picture quotient low-high='000,009.99' (mult=1);
run;
proc tabulate data=test;
class x y;
var a b;
table x,y*((a b)*sum=''*f=8. a='A/B'*pctsum<b>=''*f=quotient.)
/rts=12;
run;
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Xavier Autret
Sent: Thursday, July 15, 2004 10:11 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Too easy or that can not be done?
From that data set, I would like to have one proc that will do that
output.
Data set:
X Y a b
-----------
A 011 10 27
A 142 44 22
B 142 29 24
C 142 18 7
Output:
Y
|---------------------------|
| 011 | 142 |
|-------------|-------------|
X | a | b | a/b | a | b | a/b |
-----------------------------------
A | | | | | | |
B | | | | | | |
C | | | | | | |
For computing "a/b", I already try : proc tabulate and "<denominator
definition>", proc report and "define / across", but that just do not
work.
Is it possible in one proc?
Thks!
Xavier
|