全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2473 7
2012-11-22
data short;
input x;
datalines;
1
2
;
run;
data long;
input x;
datalines;
3
4
5
6
;
run;
data new;
set short;
output;
set long;
output;
run;


为什么生成的NEW数据集,只有4行?而且结果是  1 3 2 4 ……

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-11-23 09:48:11
不知道通过审核了没有,先自己顶下……
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-23 10:39:32
there exists 2 data loops,  for the data set having less obs contains only 2 obs.
In loop 1, the system read in x=1 and x=3 sequentially;
In loop 2, the system read in x=2 and x=4 sequentially.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-23 11:06:12
Actually there are 3 data iterations:

_N_=1:  read the first record from short(x=1), then output;
             read the first record from long(x=3), then output;

_N_=2:  read the second record from short(x=2), then output;
             read the second record from long(x=4), then output;

_N_=3: try to read the next record from short but none available, the DATA Step stops.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-23 11:15:11
嗯嗯,学习了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-23 13:34:49
多谢楼上两位大神解答
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群