SAS Base Programming for SAS 9 — Question 39
The following SAS program is submitted:
data one;
addressl = 214 London Way;
run;
data one;
set one;
address = tranwrd(address1, Way, Drive); run;
What are the length and value of the variable ADDRESS?
Answer options
- A. Length is 14; value is ‘214 London Dri’.
- B. Length is 14; value is ‘214 London Way’.
- C. Length is 16; value is ‘214 London Drive’.
- D. Length is 200; value is ‘214 London Drive’.
Correct answer: D
Explanation
The correct answer is D because the variable ADDRESS is created from ADDRESS1, which has a maximum length of 200 characters by default. The value '214 London Drive' is produced after the string replacement, making both the length and value as stated in option D. Options A, B, and C incorrectly represent the length and value of the variable.