|
Nan-
DATA DX;
INPUT care_epi dx_code $;
CARDS;
275332 1534
275332 1976
275333 5532
275333 1970
275333 V100
275334 V168
275334 4349
275335 2780
275335 3429
275335 E8781
;
PROC TRANSPOSE DATA=DX OUT=NEWDX(drop=_NAME_) PREFIX=dx_cod;
VAR dx_code;
BY care_epi;
RUN;
hth
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: Nan Li [mailto:nanl@NLCHI.NF.CA]
Sent: Friday, January 23, 2004 11:31 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Question about converting data from vertical to horizontal
Dear lister,
Could you please let me know how I could convert the following data from
vertical to horizontal. I tried to using proc transponse, but it seems not
work in the way that I want. Any help would be highly appreciated!
The input data like this:
care_epi dx_code
(numeric) (character)
275332 1534
275332 1976
275333 5532
275333 1970
275333 V100
275334 V168
275334 4349
275335 2780
275335 3429
275335 E8781
I want the output like the following:
care_epi dx_cod1 dx_cod2 dx_cod3
275332 1534 1976
275333 5532 1970 V100
275334 V168 4349
275335 2780 3429 E8781
Thanks!
Nan
By the way, could you please reply to my email, since I'm only on the digest
list. Thanks again.
|