proc sql;
create table d as
select *
from a,b
where a.code=b.code
and a.year=b.year;
可以解决(2)生成一个新的数据集d:(要求,提取相同code各year都有的数据)的问题
|
楼主: georgiagh
|
7531
11
sas对数据集合并的问题 |
|
大专生 48%
-
|
5论坛币
回帖推荐两个问题的解答,试了下符合楼主要求,前面回帖,太轻率了,没仔细看
*问题1;
proc sort data=a; by index code year; run;
proc sort data=b; by index code year; run;
data c;
merge a b;
by index code year;
run;
*问题2;
proc sort data=c out=c_temp nodupkey; by code year; run;
data d_code(keep=code); set c_temp; by code year;
retain n 0; n=n+1;
if last.code and n ...
本帖被以下文库推荐
| |
|
好好学习,天天向上
|
||
|
|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


