sas 中两个表用data set 连接后形成的表是怎么样的?

表a
部门号 地点 面积
no1 a 900
no2 b 880
no3 c 950
no4 d 600
表b
部门号 员工号 工资
no1 ed1 1000
no1 ed3 1200
no2 ed4 1300
no2 ed7 1400
如果原始文本文件里面是日期格式是'05/04/2010',input语句中的输入格式就会有错误.正确的input语句:
input date mmddyy10. time $ open high low close volume amount;
format date mmddyy10.;
run;
另一处错误:set ifa(where=(date='05/04/2010'));
在第一个数陪昌祥据步data dst.ifa;中,定义的数据集名为dst.ifa,在set语句中,缺省的引用数据迅樱集为work.ifa.而且语句date='05/04/2010'非法,必须将日期转换成SAS的日期格式,即data='04/MAY/2011'd;.
更正后的程序如下:
data dst.ifa;
infile 'C:\Documents and Settings\CY\桌面\a.txt' dlm=',';
input date mmddyy10. time $ open high low close volume amount;
format date mmddyy10.;
run;
data dst.ifa;
set dst.ifa(where=(date='04/MAY/2010'd));
run;
程序中可能存在中文输入法下的标点符号,如果不能运行,可以在这方面着手检查. 最后建议将第二个数据集命名芦搏为dst.ifb,否则第二个数据步生成的数据集将覆盖原始数据集.
data x1;
set a b;
run;
部门 地点凳悉稿 面积陆纤 员工号 工资
no1 a 900
no2 b 880
no3 c 950
no4 d 600
no1 ed1 1000
no1 ed3 1200
no3 ed4 1300
no4 ed7 1400

data x2;
set a;set b;
run;
部门 地枣孝点 面积 员工号 工资
no1 a 900 ed1 1000
no1 b 880 ed3 1200
no3 c 950 ed4 1300
no4 d 600 ed7 1400