Help using Base SAS procedures

Interleaving, Match Merging?

Reply
N/A
Posts: 0

Interleaving, Match Merging?

What's up guys?

What's the difference between interleaving and Match Merging? It seems to me that, besides the syntax difference, their functions are exactly the same.

P.S. Don't copy the links to the explanations. ty
Super Contributor
Super Contributor
Posts: 3,174

Re: Interleaving, Match Merging?

Posted in reply to deleted_user
This sounds like an interview question I've seen many times before - interleave uses SET (with or without a BY) and match-merge uses MERGE statement (with a BY statement, to achieve the match).

And, the results are very much different - suggest the OP try it with the SASHELP "sample" dataset members and use various self-diagnostic techniques, such as PROC PRINT and use a PUTLOG _ALL_; statement in the DATA step where using the SET/MERGE statements.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search arguments, this topic / post (clearly optional and no doubt extra-credit -- notice no links were contributed, nor harmed with this post-reply):

data step programming set merge site:sas.com

data step programming by group processing site:sas.com Message was edited by: sbb
PROC Star
Posts: 7,474

Re: Interleaving, Match Merging?

Posted in reply to deleted_user
William,

You either already have received the answer to your question or you asked the wrong question. I'm going to assume the latter although I really can't recall what the following merging type is called.

If you were asking what the difference was between merging with NO by statement, and the equivalent of merging by using two set statements with NO by statement, then I think that the answer is basically none.

That is, if the following code represents what you were asking:

data want1;
merge have1 have2;
run;

data want2;
set have1;
set have2;
run;
Ask a Question
Discussion stats
  • 3 replies
  • 726 views
  • 0 likes
  • 4 in conversation