Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need to merge two data sets that have no common variable, and only one variable apiece. One data set is about 200 lines of unique values and the other is 80,000 unique lines. I have tried the common merges, but cannot get what I'm looking for. The following is what I'm after:

Set a variables: x y

Set b variables: 1 2 3

Desired merged data sets result (2 columns):

x 1
x 2
x 3
y 1
y 2
y 3

Thanks for any insight.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
220 views
Welcome To Ask or Share your Answers For Others

1 Answer

From my understanding of your question, it seems like you're trying to do a many to many merge. Try a proc sql cross join/cartesian product:

proc sql;
create table want as
select
*
from have1, have2;
quit;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...