m**o 发帖数: 5261 | 1 data _null_;
do i=1 to 30;
string='a';
string=string||'3';
put string;
end;
run;
Why the value of variable "string" is 'a' and why '3' is not attached?
Thank you |
k*******a 发帖数: 772 | 2 because the length by default in your code is only 1
you can add length string $100;
and use string=strip(string)||'3'
【在 m**o 的大作中提到】 : data _null_; : do i=1 to 30; : string='a'; : string=string||'3'; : put string; : end; : run; : Why the value of variable "string" is 'a' and why '3' is not attached? : Thank you
|
q**j 发帖数: 10612 | 3 it is initiated as a character variable with length 1.
【在 m**o 的大作中提到】 : data _null_; : do i=1 to 30; : string='a'; : string=string||'3'; : put string; : end; : run; : Why the value of variable "string" is 'a' and why '3' is not attached? : Thank you
|
m**o 发帖数: 5261 | 4 got it. Thank you
【在 k*******a 的大作中提到】 : because the length by default in your code is only 1 : you can add length string $100; : and use string=strip(string)||'3'
|