SAS Base Programming for SAS 9 — Question 40
The following SAS program is submitted:
data WORK.ONE;
Text=Australia, US, Denmark;
Pos=find(Text,US,i,5);
run;
What value will SAS assign to Pos?
Answer options
- A. 0
- B. 1
- C. 2
- D. 12
Correct answer: D
Explanation
The FIND function in SAS looks for the substring 'US' in the variable Text, starting the search from position 5. In the string 'Australia, US, Denmark', 'US' is located at position 12, making the correct value for Pos be 12. The other options, 0, 1, and 2, do not correspond to the actual position of 'US' in the string.