1 Star 0 Fork 0

yzw554350785/Programming-SAS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Cartesian Product datastep.sas 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
Jiangtang Hu 提交于 2015-09-24 13:28 . bulk upload
/*http://support.sas.com/kb/24/652.html*/
/* Create two test data sets */
data one;
input id $ fruit $;
datalines;
a apple
a apple
b banana
c coconut
c coconut
c coconut
;
data two;
input id $ color $;
datalines;
a amber
b brown
b black
c cocoa
c cream
;
data every_combination;
/* Set one of your data sets, usually the larger data set */
set one;
do i=1 to n;
/* For every observation in the first data set, */
/* read in each observation in the second data set */
set two point=i nobs=n;
output;
end;
run;
proc print data=every_combination;
run;
proc sql;
create table three as
select one.*
,two.color
from one
,two;
quit;
proc print data=three;
run;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yzw554350785/Programming-SAS.git
git@gitee.com:yzw554350785/Programming-SAS.git
yzw554350785
Programming-SAS
Programming-SAS
master

搜索帮助