写了一段程序,想实现的功能是:如果城市是昆明并且B07(老的错乱的编码变量)的变量=0,那么新变量B07new对应=1,
以此类推,但是运行程序sas没有报错,但是却没有执行所有的if else 语句,打印出来的b07new 都是和b07一样的。请问这是咋回事儿呢?所有的变量都是字符型的。先谢过了!!
data rec1;/*更改错误编码*/
set c1;
b07new=b07;
if city="昆明"and b07="0" then b07new="1";
else if city="昆明" and b07="1" then b07new="2";
else if city="昆明" and b07="3" then b07new="3";
else if city="昆明"and b07="4" then b07new="4";
proc print data=rec1;
var b07new;
run;