Date: Wed, 20 Mar 2002 18:21:39 +0100
Reply-To: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject: Re: Using MERGE with identical data set names
Content-Type: text/plain
Hi Doug,
You may use the same dataset name for input and output, i.e. DATA and SET or
MERGE or UPDATE. And. I think, you may add variables with UPDATE.
Regards - Jim.
--
Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070
senior statistician, P.O. Box 1 fax. +31 412 407 080
senior data manager 5350 AA BERGHEM IMRO TRAMARKO: a CRO
J.Groeneveld@ITGroups.com the Netherlands in clinical research
My computer beeps when it complains; I complain when it beeps
Notice of confidentiality: this e-mail may contain confidential information
intended for the addressed recipient only.
If you have received this e-mail in error please delete this e-mail and
please notify the sender so that proper delivery
can be arranged.
> -----Original Message-----
> From: Cacialli, Doug [SMTP:Doug_Cacialli@URMC.ROCHESTER.EDU]
> Sent: Wednesday, March 20, 2002 6:14 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Using MERGE with identical data set names
>
> Y'all,
>
> I'm hoping this is a question that won't be too awfully hard to answer.
> I'm
> trying to merge multiple data sets using a macro. The macro is necessary
> because I won't know how many data sets I'm merging going in. I have a
> macro variable (&maxvar) which is the number of data sets, and my macro
> looks a little something like this:
>
> %macro sleep_merge;
> %do i = 1 to &maxvar;
> data sleeptime1;
> merge sleeptime1 sleeptime&i;
> by id;
> run;
> %end;
> %mend sleep_merge;
>
> My question is whether I can use the same data set name for the new data
> set
> and data set 1? I can't use UPDATE to add variables, can I? I'm open to
> any ideas. Thanks in advance!
>
> Regards,
>
> Doug
> ----------------------------------------------------------------------
> Doug Cacialli - Information Analyst / Laboratory Coordinator
> Sleep Research Laboratory
> Department of Psychiatry
> URMC - Strong Memorial Hospital
> 300 Crittenden Blvd.
> Rochester, New York 14642
> Phone - (585) 275-2900 Fax - (585) 273-3682
> ----------------------------------------------------------------------
|