作者green72 (圈叉)
看板Statistics
标题[程式] sas资料处理
时间Wed Apr 2 00:59:32 2014
[软体程式类别]:
SAS
[程式问题]:
资料处理
[软体熟悉度]:
新手(不到1个月)
[问题叙述]:
我有两份资料需要合并,A资料是年资料,B资料是月资料,例如:
A资料 B资料
firm yearmonth a firm yearmonth ret
1101 199012 1 1101 199101
1102 199012 2 1102 199101
1101 199112 3 1101 199102
1102 199112 4 1102 199102
....
1101 199201
1102 199201
我的问题在於我要将A资料中每年度的a贴到B资料"下一年度"的每个月份中
合并後的资料如下
firm yearmonth ret a
1101 199101 1
1102 199101 2
1101 199102 1
1102 199102 2
....
1101 199201 3
1102 199201 4
请版上高手解救,感谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 42.79.248.152
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Statistics/M.1396371575.A.9B5.html
1F:→ BugEater:A资料新创变量year为yearmonth里面的year+1 04/02 04:45
2F:→ BugEater:B资料新创变量year为yearmonth里面的year 04/02 04:46
3F:→ BugEater:各自分别都用firm和year排序,然後合并,去掉year。 04/02 04:47
4F:→ green72:感谢BugEater 04/02 21:52