Date: Tue, 7 Jun 2005 15:53:31 -0400
Reply-To: BJ Mattson <bmattson@ODH.OHIO.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: BJ Mattson <bmattson@ODH.OHIO.GOV>
Subject: Re: Help with Coding
This might be more like what you had in mind; I quick tested it and it
puts the doses in the correct order horizontally. If you need it
vertically, just add transpose.
data work.drug;
input
ID A100_1 A100_2 A100_3 A100_4 A100_5
A150_1 A150_2 A150_3 A150_4 A150_5
A200_1 A200_2 A200_3 A200_4 A200_5 ;
* set up arrays of the 3 dose levels and one for the dose order;
array A100 (5) A100_1 A100_2 A100_3 A100_4 A100_5;
array A150 (5) A150_1 A150_2 A150_3 A150_4 A150_5;
array A200 (5) A200_1 A200_2 A200_3 A200_4 A200_5;
array dose (5) dose_1 dose_2 dose_3 dose_4 dose_5 (0 0 0 0 0);
* fill in the dose order;
do i = 1 to 5;
if A100(i) = 1 then dose (i) = 100; else
if A150(i) = 1 then dose (i) = 150; else
if A200(i) = 1 then dose (i) = 200;
end;
<data lines omitted>
BJ Mattson
Epidemiology Investigator III
Ohio Department of Health
|