Date: Tue, 3 Aug 2010 16:49:28 -0500
Reply-To: matt.pettis@THOMSONREUTERS.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Matthew Pettis <matt.pettis@THOMSONREUTERS.COM>
Subject: Re: Displaying all textual data in a table
In-Reply-To: <16FD64291482A34F995D2AF14A5C932C0937A31A@MAIL002.prod.ds.russell.com>
Content-Type: text/plain; charset="us-ascii"
Thanks Mark,
This would work -- I just assumed that the 'var' columns had to be
numeric/analyzable, and didn't do my due diligence to actually go back
and check the documentation (slaps forehead) -- thanks! I think Data
_Null_ had what I had originally envisioned PROC REPORT could do, if I
just knew how... I'll respond to his email & the list to keep me from
being so chatty on the list.
Thanks for the time and effort,
Matt
-----Original Message-----
From: Terjeson, Mark [mailto:Mterjeson@russell.com]
Sent: Tuesday, August 03, 2010 4:39 PM
To: Pettis, Matthew (Legal); SAS-L@LISTSERV.UGA.EDU
Subject: RE: Displaying all textual data in a table
Hi Matt,
Will this work as one approach:
proc transpose data=have out=need(drop=_name_);
by r;
id c;
var d;
run;
proc print data=need;
run;
Hope this is helpful.
Mark Terjeson
Investment Business Intelligence
Investment Management & Research
Russell Investments
253-439-2367
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Matthew Pettis
Sent: Tuesday, August 03, 2010 2:34 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Displaying all textual data in a table
Hi,
Is there a nice proc to display data that is all textual, and has no
numeric/analysis data? I have the following dataset, and I'd like to
display it as shown below, but I cannot figure out a simple proc to do
so. Has anybody else had this problem, and/or does anybody have a
solution?
If the final output doesn't format correctly in your email or however
you read this post, it should have 'c' values as column headers, 'r'
values as row labels, and 'd' data as cell entries in the table.
PROC REPORT and PROC TABLULATE, as far as I can tell, require that the
cells of the data have some numeric analysis variable. Also, I could
fake this out with PROC PRINT or the like, but I'd rather not have to do
any data manipulation to the table if I can make a PROC do the work for
me.
Thanks,
Matt
=== Input Data ===
data have;
infile datalines;
input r:$2. c:$2. d:$3.;
datalines;
r1 c1 d11
r1 c2 d12
r1 c3 d13
r2 c1 d21
r2 c2 d22
r2 c3 d23
r3 c1 d31
r3 c2 d32
r3 c3 d33
;
run;
=== Output should look like ===
c1 c2 c3
r1 d11 d12 d13
r2 d21 d22 d23
r3 d31 d32 d33