标题: 关于MERGE DATASET [打印本页] 作者: shiyiming 时间: 2004-7-23 08:33 标题: 关于MERGE DATASET 第一组中 variable 'code' is all missing. I want to merge it with data
two, and get the result 'data three', like this:
Obs id term code
1 1 head 1234
2 1 head 1234
3 1 skin 5678
4 1 skin 5678
5 2 head 4321
6 2 head 4321
7 2 head 4321
8 2 skin 8765
9 2 skin 8765
But I got this: <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
Obs id term code
1 1 head 1234
2 1 head .
3 1 skin 5678
4 1 skin .
5 2 head 4321
6 2 head .
7 2 head .
8 2 skin 8765
9 2 skin .
Please give my some suggestions. Thank you guys so much!!!!!
data one;
input id term$ code;
cards;
1 head .
1 head .
1 skin .
1 skin .
2 head .
2 head .
2 head .
2 skin .
2 skin .
;
run;
data two;
input id term$ code;
cards;
1 head 1234
1 skin 5678
2 head 4321
2 skin 8765
;
run;
data three;
merge one two;
by id term;
run;
proc print data=three;
run;作者: shiyiming 时间: 2004-7-23 11:38 标题: re data one;
input id term$;
cards;
1 head
1 head
1 skin
1 skin
2 head
2 head
2 head
2 skin
2 skin
;
run;
data two;
input id term$ code;
cards;
1 head 1234
1 skin 5678
2 head 4321
2 skin 8765
;
run;
data three;
merge one two;
by id term;
run;