- data a1;
- input x;
- cards;
- 1000
- ;
- run;
- data a2;
- input y;
- cards;
- 123
- 234
- 23
- 456
- ;
- run;
- data e;
- if _n_=1 then set a1; set a2;
- run;

|
楼主: Imasasor
|
3390
5
[原创博文] 关于两个set的问题 |
|
已卖:215份资源 学科带头人 33%
-
TA的文库 其他...
|
回帖推荐为什么上述程序最后出现了4个观测中x都有值呢,我想着,只有第一个观测x=1000, 其它都应该为空啊?
No. All variable on a data set is retained automatically. X is a variable on a1.
不是吗?求高手解答,因为只有_n_=1时才set a1, 其它时候都不set了
Yes. Set is a executable statement. it only executes once when _n_=1.
Here is an example to help you understand it. I add additional observation ...
| ||
|
|
| ||
|
80 字节以内
不支持自定义 Discuz! 代码 |
||
| ||
|
欢迎加入亚太地区第一R&Python数据挖掘群: 251548215;
|
||
| ||
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


