BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
art297
Opal | Level 21
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;

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3349 views
  • 0 likes
  • 4 in conversation