Date: Wed, 15 May 2002 23:56:02 +0100
Reply-To: John Whittington <John.W@MEDISCIENCE.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: John Whittington <John.W@MEDISCIENCE.CO.UK>
Subject: Re: Creating duplicate records
In-Reply-To: <E1780rh-0001UX-00@relay1.netnames.net>
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 15:17 15/05/02 -0700, Daren Austin wrote:
>For some obscure reason I need to INSERT duplicates of a record at
>certain points in a database with a single variable changed (I'm
>creating a control file for a pharmacokinetic analysis using NONMEM if
>that means anything to anyone here). Could someone point me in the
>correct direction please.
>
>Essentially I want something like:
>
>if first.dose then... duplicate this record only
>
>The record will ultimately not be exactly identical but I'll change
>the single parameter (called CMT) on a second data step.
Daren, if I understand your requirement correctly, then how about something
like:
data new ;
set yourdata ;
by dose ;
output ;
if first.dose then output ;
run ;
Would that do the trick? The first OUTPUT statement outputs one copy of
every observation, and the conditional one just the duplicates you appear
to want. In fact, you might even be able to do your altering of CMT in the
same step, by altering the IF statement in the above to something like:
if first.dose then do ;
CMT = <whatever> ;
output ;
end ;
Does that help?
Kind Regards
John
----------------------------------------------------------------
Dr John Whittington, Voice: +44 (0) 1296 730225
Mediscience Services Fax: +44 (0) 1296 738893
Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk
Buckingham MK18 4EL, UK mediscience@compuserve.com
----------------------------------------------------------------