首页 > 其他 > 详细

sas20210507

时间:2021-05-07 12:22:30      阅读:27      评论:0      收藏:0      [点我收藏+]

data a;
set sashelp.class;

proc print;
/*////////////////////////////////////////////////////////*/
data a;
input x @@;

if 1<=x<=5 then
goto ok;
put x;
count+1;
ok:
sumx+x;
cards;
1 2 7 2 12 24 22
;

proc print;
data a;
input x @@;

if 1<=x<=5 then
goto ok;
put x;
count+1;
return;
ok:
sumx+x;
cards;
1 2 7 2 12 24 22
;

proc print;
/*///////////////////////////////////////////////////*/
data a;
input type $ wd station $;
label type=‘station type‘ wd=‘depth to water‘;
elev=.;

if type=‘aluy‘ then
link calcu;
year=1985;

/*返回data头部*/
return;
calcu:

if station=‘site_1‘ then
elev=6650-wd;

if station=‘site_2‘ then
elev=5500-wd;

/*返回link后一行代码*/
return;
cards;
aluv 523 site_1
uppa 234 stte_2
aluy 666 site_2
;

proc print;
/*/*////////////////////////////////////////////////////////*/*/
data a;
do i=1 to 5;
input name $ idno status$;
if status=‘PT‘ then continue;
input benefits $10.;
output;
end;
cards;
Jones 9011 PT
Thomas 876 PT
Richards 1002 FT
Eye/Dental
Kelly 85111 PT
Smith 433 FT
HMO
Jones 9011 PT
Thomas 876 PT
Richards 1002 FT
Eye/Dental
;

proc print;
/*//////////////////////////////////////////////////////////////*/
proc sgplot data=sashelp.cars;

scatter x=MSRP y=Horsepower/group=type;

run;
data a;
set sashelp.cars;
proc print;
/*1加仑的油跑的英里数——mpg*/

 

sas20210507

原文:https://www.cnblogs.com/anxiaoni/p/14738108.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!