作者chinmantic (冬去春来秋又过)
看板Statistics
标题[问题] sas 的merge问题
时间Wed Sep 10 19:00:13 2008
想请教SAS的MERGE问题
我要合并两个年度的资料 依照ID来合并
以下是合并指令:
data test;
set aa;
proc sort out=a;
by id;
run;
data test2;
set bb;
proc sort out=b;
by id;
run;
data new;
set b a;
merge a(in=ina) b(in=inb);
by id;
if a and inb then output ;
run;
LOG档为:
NOTE: Variable a is uninitialized.
NOTE: There were 61142 observations read from the data set WORK.B.
NOTE: There were 60036 observations read from the data set WORK.A.
NOTE: There were 60044 observations read from the data set WORK.A.
NOTE: There were 61142 observations read from the data set WORK.B.
NOTE: The data set WORK.NEW has 0 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 0.43 seconds
cpu time 0.40 seconds
想请问为何在NEW中没有观察值呢?
另外 我合并很多笔资料
同样的语法 有的资料可以合并 有的却出现以上的情况
请问是哪里出了问题吗?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.92.101
1F:推 bugle:set 又 merge 你叫 data step 执行那个? 09/10 19:12
2F:→ chinmantic:谢谢楼上指教 我最大的问题是合并ab没问题 但合并cd却 09/10 19:21
3F:→ chinmantic:发生如文中叙述的问题 (使用同样的语法) 09/10 19:21
4F:推 tew:基本上 你的程式依然是有问题的,即使合并a b没问题 09/11 01:15
5F:推 tew:不表示指令是正确的,错误的研究逻辑可以得到正确的结果 09/11 01:15
6F:推 tew:不能表示研究逻辑就是正确的,以结果论来回溯程式正确 很可怕 09/11 01:16