王笑权
data a;
infile 'd:\sj\xe.txt';
length x4 $ 6. x5 $ 6. x9 $ 6.;
x12='正常';
drop x6;
input x3-x10;
do x1=5 to 8;/*从5月份开始 8月10号左右结束*/
do x2=1 to 31;/*每月日期*/
if x1=5 & x2<3 then continue;/*5月份从3号开始*/
if x1=6 & x2=31 then continue;/*6月份不存在31号*/
if x1=8 & x2>=10 then delete;/*超过当前月份、日期删除*/
x11=36.5+0.55*normal(0);
format x11 4.1;output;end;end;
proc sort;by x3 descending x7;/*组别增序,生日降序*/run;
data c;
infile 'd:\sj\xe2.txt';input x3 x4 $ x5 $ x7 x8 x9 $;
data b;set c a;/*转换过程完成*/
file '桌面\预防≤┣▇▇▇═—╰⊙═⊙╯∝╬══→▄【┳═一oO★☆≥病××村适龄儿童健康调查资料.doc';/*doc|txt*/
if x10= 5858018 & x1=6 & x2>=22 & x2<=31 | x10= 5858018 & x1=7 & x2<=4 then x12='生病';
if _n_=1 then put '预防≤┣▇▇▇═—╰⊙═⊙╯∝╬══→▄【┳═一oO★☆≥病××村适龄儿童健康调查资料';
put x1 x2 x3 x4 $ x5 $ x7 x8 $ x9 $ x10 x11 $ x12 $;
label x1='月份' x2='日期' x3='组别' x4='丈夫姓名' x5='妻子姓名' x6='孩次' x7='出生年月' x8='性别 (1男 2女)'
x9='子女姓名' x10='联系电话' x11='参数';
proc print data=b label noobs n='钻晕';
run;