Date: Mon, 4 Nov 2002 15:02:46 -0500
Reply-To: Howard_Schreier@ITA.DOC.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard_Schreier@ITA.DOC.GOV
Subject: Re: Merge tip
There is no code shown, and no sample data, so it's kind of hard to
precisely identify the problem.
My impression is that there is no BY statement. That's because with a BY,
the processing logic is is compartmentalized for each BY group and it makes
little sense to characterize one dataset as being shorter overall.
So one possible solution is to replace the MERGE statement with two SET
statements.
Example:
data short; do a = 1,3,5; output; end; run;
data long; do b = 2,4,6,8; output; end; run;
data use_merge;
merge short long;
run;
data use_2sets;
set short; set long;
run;
USE_MERGE will have four observations, but USE_2SETS will have only three.
On Mon, 4 Nov 2002 01:38:38 -0800, Pacal <pacal2012@HOTMAIL.COM> wrote:
>Hi.
>I would merge two data set but at the end of the shorter one
>I would the data step will stop. Any suggestion?
>I can do this merge with another data step before but I'd like
>to optimize this step.
>
>Thanks,
>Pacal