```Date: Thu, 8 May 2008 09:40:36 -0700 Reply-To: "Huang, Ya" Sender: "SAS(r) Discussion" From: "Huang, Ya" Subject: Re: proc tabulate without pre-processing data ? Comments: To: Robin R High In-Reply-To: Content-Type: text/plain; charset="us-ascii" Thanks, but I was curious if there is a way not to transpose the data first. ________________________________ From: Robin R High [mailto:rhigh@unmc.edu] Sent: Thursday, May 08, 2008 9:38 AM To: Huang, Ya Cc: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc tabulate without pre-processing data ? Ya, Since tabulate tends to work best with data in univariate format, a simple transformation within the DATA step can produce the desired table. data x; LENGTH vr1 vr2 \$1 ; keep vr1 vr2 y; array ab{6} a1 a2 a3 b1 b2 b3; a1=1; a2=2; a3=4; b1=23; b2=45; b3=32; DO i = 1 to 6; vr2 = UPCASE(SUBSTR(vname(ab{i}),1,1)); vr1 = SUBSTR(vname(ab{i}),2,1); y = ab{i}; OUTPUT; END; run; proc tabulate noseps; CLASS vr1 vr2; var y; table vr1=' ', vr2=' '*y=' '*sum=' '*f=5.0 / rts=8; run; Robin High Univ. of Nebr. Medical Center Ya Huang Sent by: "SAS(r) Discussion" 05/08/2008 11:10 AM Please respond to Ya Huang To SAS-L@LISTSERV.UGA.EDU cc Subject proc tabulate without pre-processing data ? Hi there, Given the following data (one obs, multiple vars): data x; a1=1; a2=2; a3=4; b1=23; b2=45; b3=32; run; I wonder if it is possible to use proc tabulate alone to get the following layout: --------------------- | | A | B | |-------+-----+-----| | 1 | 1 | 23 | | 2 | 2 | 45 | | 3 | 4 | 32 | --------------------- Thanks Ya ```

Back to: Top of message | Previous page | Main SAS-L page