全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3930 0
2016-10-09
ARRAYs and DO OVER loops are a way of programming more efficiently. Using them can save
writing many lines of code, can reduce the risk of error, and can make error detection and correction easier.

from http://staff.washington.edu/glynn/array.pdf


* array1.sas ;
title1 'array1.sas'  ;
options compress = yes nodate ;
data one;
input v1 - v3 ;
cards ;
.2 .3 .4
.5 .6 .321
.21 .3 .4
.15 .36 .13
;
run;

data two;
set one ;
a1 = v1 * 100 ;
a2 = v2 * 100 ;
a3 = v3 * 100 ;

array orig v1 - v3 ;
array perc p1 - p3 ;

do over orig ;
perc = orig * 100 ;
end;
run;

proc print ;
run ;
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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