Multiple choice technology programming languages

What is the length of variable a ? data temp; a=substr('joshi anand',1,3); run;

  1. 3

  2. 11

  3. 8

  4. 200

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In SAS, when a character variable is created without an explicit LENGTH statement and assigned from a function like SUBSTR, it inherits the length of the SOURCE string (11 characters for 'joshi anand'), not the length of the substring result (3 characters). The variable 'a' has length 11.