An automatic data conversion is performed whenever a numeric variable is used where
SAS expects a character value. The numeric variable is written with the BEST12. format
and the resulting character value is right-aligned when the conversion occurs. In this
example, the value of Phonenumberis converted to character and right-aligned before the
SUBSTR function is performed. Since there are only 10 digits in the value of
Phonenumber, the right-aligned value begins with two blanks. Therefore the SUBSTR
function picks up two blanks and a 3, and uses the BEST12. format to assign that value to
Code. Then, the parentheses are concatenated before and after the two blanks and a 3.
|