Help using Base SAS procedures

Interleaving, Match Merging?

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?

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

data step programming by group processing Message was edited by: sbb
Posts: 7,356

Re: Interleaving, Match Merging?


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;

data want2;
set have1;
set have2;
Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation