jingju11 发表于 2012-10-10 10:43 
am i wrong?
b is 3-letter long, character. c is numeric. the print cannot tell anything here. you c ...
You are right!
当数值赋值给字符型变量时,会发生自动类型转换,而且字符型变量的长度也会作为一个考虑因素,即SAS会尽可能准确的吧数值转化为字符的形式。
25 data test;
26 a=2020;
27 b='abc';
28 b=a;
29 c=a+b;
30 put a= b= c=;
31 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
28:3
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
29:5
a=2020 b=2E3 c=4020
NOTE: The data set WORK.TEST has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):