SAS并没有共同的变量 [英] SAS merging with no common variable

查看:409
本文介绍了SAS并没有共同的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要合并两个没有共同变量的数据集,只有一个变量。一个数据集是大约200行的唯一值,另一个数据集是80,000个独特的行。我已经尝试了共同的合并,但不能得到我正在寻找。以下是我之后:

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:

设置变量:xy

设置b变量:1 2 3

Set b variables: 1 2 3

所需的合并数据集结果(2列):

Desired merged data sets result (2 columns):

x 1

x 2

x 3

y 1

y 2

y 3

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

感谢任何见解。

推荐答案

从我对你的问题的理解看来,你似乎正在尝试多次合并。尝试一个proc sql cross join / cartesian产品:

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;

这篇关于SAS并没有共同的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆