SAS_Institute
A00-202 · Question #50
Given the following SAS statement: %let idcode = Prod567; Which one of the following statements stores the value 567 in the macro variable CODENUM?
The correct answer is D. %let codenum = %substr(&idcode,%length(&idcode)-2). See the full explanation below for the reasoning.
Question
Given the following SAS statement:
%let idcode = Prod567; Which one of the following statements stores the value 567 in the macro variable CODENUM?
Options
- A%let codenum = substr(&idcode,length(&idcode)-3);
- B%let codenum = %substr(&idcode,%length(&idcode)-3);
- C%let codenum = substr(&idcode,length(&idcode)-2);
- D%let codenum = %substr(&idcode,%length(&idcode)-2);
How the community answered
(27 responses)- A11% (3)
- B7% (2)
- C4% (1)
- D78% (21)
Community Discussion
No community discussion yet for this question.