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*/
原文:https://www.cnblogs.com/anxiaoni/p/14738108.html