data _null_;
n=4;
do;
put "hello world";
n=n+2;
end;
if mod(n,2)=0 then
do;
sum+n;
put n=;
end;
run;
data _null_;
x=rand('normal');
ispositive=0;
if x>=0 then ispositive=1;
put x= ispositive=;
run;
data _null_;
x=rand('bernouli',0.5);
if x=1 then do;
isup=1;
put "硬币国徽朝上 " isup=;
end;
else do;
isup=0;
put "硬币国徽朝下 " isup=;
end;
run;
data myclass;
set sashelp.class;
if age>13;
run;
proc print data=myclass;
run;
data _null_;
x=ceil(rand("uniform")*6);
put "x=" x;
select(x);
when (1) put "1";
when (2) put "2";
otherwise put "*****";
end;
run;
data _null_;
array myarray [5] _temporary_ (1,2,3,4,5);
do i=1 to dim(myarray) by 2;
put myarray[i] @@;
end;
run;
data _null_;
sum=0;
n=1;
do while(n<=100);
sum=sum+n;
put n= sum
SAS数据分析巧用循环使用技巧
最新推荐文章于 2023-08-24 15:04:04 发布
本文深入探讨了在SAS数据分析中如何巧妙运用循环技术,包括DO loops, WHILE loops和PROC步的使用,旨在提高效率并解决复杂问题。通过实例解析,展示了循环在大数据处理、统计建模和报告生成等场景下的实用技巧。"
83032768,7529967,MySQL数据库中文乱码解决方案及常用SQL操作,"['数据库管理', 'MySQL', 'SQL', '字符编码']
摘要由CSDN通过智能技术生成