我有数据集M
number id_no date
1 123 3/3/2012
2 123 3/3/2012
3 . .
4 . .
如何将123和3/3/2012复制到obs 4& 5。
答案 0 :(得分:0)
这应该可以帮助你。
data one;
input
number id_no date mmddyy10.;
format date mmddyy10.;
datalines;
1 123 3/3/2012
2 123 3/3/2012
3 . .
4 . .
5 456 .
;
run;
proc sort data = one;
by number;
run;
data two;
set one;
retain _id_no _date;
if missing(_id_no) then _id_no = id_no;
if missing(id_no) then id_no = _id_no;
if missing(_date) then _date = date;
if missing(date) then date = _date;
drop _id_no _date;
run;