|
Kumar -
Try composing your note in plain text before you post it. It isn't very
readable the way it appears, your tables were expanded to columns and your
code is double spaced.
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sridhar, Kumar
Sent: Monday, December 20, 2004 8:35 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Help with Datastep..
Hi All:
Let me explain what I am trying to do before asking all of you how
to do it. The dataset has observations that currently look like so:
Cchem
Vtid
Val so
n
Mean
SD
Max
Median
Min
Creatinine (µmol/L)
Screening
Value 1
17
66.2
14.5
97.0
62.0
44.0
Infusion
Value 1
17
66.2
14.5
97.0
62.0
44.0
Change 2
17
7.8
11.8
27.0
8.0
-18.0
But I would like them to like so:
Cchem
Vtid
Val so
n
Mean
SD
Max
Median
Min
Creatinine (µmol/L)
Screening
Value 1
17
66.2
14.5
97.0
62.0
44.0
Infusion
Value 1
17
66.2
14.5
97.0
62.0
44.0
Change 2
17
7.8
11.8
27.0
8.0
-18.0
Here's the code that I wrote (could somebody take a look at this and tell me
where all I am going wrong).
proc sort data=u3;
by chemseq vtid so ;
run;
data new(drop=chemseq siunit);
set u2 u3;
by chemseq vtid so;
cchem=trim(left(put(chemseq,chem.)))||' ('||trim(left(siunit))||')';
pageit=int((_n_-1)/30);
if last.chemseq and last.vtid and last.so then do;
cchem=' ';
vtid=' ';
val=' ';
n=' ';
mean=' ';
std=' ';
min=' ';
median=' ';
max=' ';
so=' ';
end;
run;
Thanks and regards
Kumar
|