Multiple choice technology programming languages

Which DO statement would not process all the elements in the tmp array shown below? array tmp{*} x y z a;

  1. do i=1 to dim(tmp);

  2. do i=1 to dim(*);

  3. do i=1,2,3,4;

  4. do i=1 to 4;

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

The dim function in SAS requires a valid array name as its argument to return the number of elements. Using dim(*) is syntactically invalid and causes an error. In contrast, dim(tmp), a list of explicit indices 1,2,3,4, or the range 1 to 4 correctly reference all four array elements.