Q1:经常看到data A文件;
set B文件;
这表明创建一个A文件,然后复制B文件中的数据对不?
Q2: 下面一组代码,为什么刚开始要retain y1? retain是用作什么的?
data smart;
retain y1;
if _n_=1 then y=1;else y=2*y1;y1=y;if _n_ =100 then stop;run;谢谢啦~
楼主: yellowriver
|
33965
23
弱问:set 和retain语句怎么用? |
博士生 38%
-
|
回帖推荐Q1:
data a;
set b;
run;
Set的作用是将数据集b中的记录逐条读入PDV中,在run语句的地方SAS会将pdv中的变量输出到数据集a中。
SAS帮助:
What SET DoesEach time the SET statement is executed, SAS reads one observation into the program data vector. SET reads all variables and all observations from the input data sets unless you tell SAS to do otherwise. A SET statement can contain multipl ...
本帖被以下文库推荐
| ||
| ||
和谐拯救危机
|
||
| ||
welcome to
http://stochasticquant.com/ |
||
京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明 免责及隐私声明