| Date: | Tue, 3 Aug 2010 16:51:44 -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: | <AANLkTi=nRtYk=cTJ4Dkbr83WrktRNGfKtBgZqnKhqpbU@mail.gmail.com> |
| Content-Type: | text/plain; charset="us-ascii" |
Thanks Data _null_ and Mark Terjeson for their solutions -- both work
really well. I plan on using Data _null_'s solution as it fits my 'do
it in a proc' desire...
Thank you both,
Matt
-----Original Message-----
From: Data _null_; [mailto:iebupdte@gmail.com]
Sent: Tuesday, August 03, 2010 4:42 PM
To: Pettis, Matthew (Legal)
Cc: SAS-L@listserv.uga.edu
Subject: Re: Displaying all textual data in a table
It's a kind of trick in proc report. It is documented somewhere I
thing.
proc report nowd list;
columns r c, d dummy;
define r / group ' ';
define c / across ' ';
define d / display '--';
define dummy / noprint;
run;
On 8/3/10, Matthew Pettis <matt.pettis@thomsonreuters.com> wrote:
> 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
>
|