littlewangle 发表于 2019-2-27 16:01 
“Type”新变量格式和长度没有定义,原代码第一行会定义“Type”是数值型,长度为1,而一个汉字字符的长度是 ...
明白了,解释很到位。已经更正:
data beijing_price;
set sasuser.salary;
if city="北京";
dp=dif(price);
if dp=. then dp=price;
if dp<0 then type="跌";
else if dp=0 then type="平";
else if dp>0 then type="涨";
proc print;
run;