全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1337 4
2016-06-12
proc sort data=DSdata._Benchmark1;by date;run;
proc sort data=DSdata._all2;by date;run;
方法一
proc sql;
create table DSdata._all1_Benchmark as
select a.*,b.BDR,b.BLR
from DSdata._all2(rename=(n=nid Date=Date)) as a inner join DSdata._Benchmark1 as b on a.date=b.date ;
quit;


方法二
data DSdata._all1_Benchmark;
    merge DSdata._all2 (in=a) DSdata._Benchmark1(in=b);
          by  date;
            if a=1 and b=1;
          rename n=nid;
run;

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-6-12 22:48:17
yunnandlg 发表于 2016-6-12 22:34
proc sort data=DSdata._Benchmark1;by date;run;
proc sort data=DSdata._all2;by date;run;
方法一
这是什么软件
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-6-12 22:54:02
nielei5515 发表于 2016-6-12 22:48
这是什么软件
SAS 系统
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-6-14 09:23:51

Well, that depends on your data and what you mean by “efficient”. You have to know the following:
• the relationship between the tables
• the sparseness or density of matches
• the size of the tables
• the availability of an index or sort flag
When data sets are large and unsorted, the SQL inner join might outperform SORT and MERGE. If you have a long
series of SORT and DATA steps, the SQL inner join might be easier to code and read.
In most cases, a DATA step MERGE statement generally outperforms an SQL outer join, even taking sort resources
into account.
One exception is a very sparse match join when you only want the observations with matching key values.
附件列表

A Guide to Efficient PROC SQL Coding.pdf

大小:2.92 MB

 马上下载

A Guide to Efficient PROC SQL Coding

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-6-14 10:43:27
l1i2n3i4n5g 发表于 2016-6-14 09:23
Well, that depends on your data and what you mean by “efficient”. You have to know the following ...
谢谢分享。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群