data work.AreaCodes;
Phonenumber=3125551212;
Code='('!!substr(Phonenumber,1,3)!!')';
run;
Which one of the following is the value of the variable Code in the output data set?
a. ( 3)
b. (312)
c. 3
d. 312
Answer:
Tips: the substr function convert the numerical variables to character variables, the length is 12, the format is best12.