/*if判断 */
data custer;
input id $ level $ amount 5. @;
label id=‘卡编号’ level=‘级别’ amount=‘信用额度’;
cards;
1001 A 199
1002 B 100
1003 C 2000
1004 A 223432
1005 B 100032
1006 C 100000
;
data atype btype ctype;
set custer;
if level='A' then
output atype;
else if level='B' then
output btype;
else output ctype;
run;
proc print data=ctype label;
title “c类信用卡额度”;
run;
/* select when (when) otherwise */
data zonecity;
input zone $ address $ @@;
cards;
100070 丰台区 272192 微山县 200000 北京
;
data changezone;
set zonecity;
select;
when (zone=“100070”) zone=“北京”;
when (zone=“020”) zone=“山东”;
otherwise zone=“其他省份”;
end;
run;
/* do while (先判断 后执行) */
data autoplus;
x=0;
do while (x<11);
x=x+2;
end;
;
put x=; /* 输出到日志窗口 */
run;
/* do until 先执行 后判断*/
data un;
x=8;