Multiple choice technology programming languages

data new;input x $ @;if X='A' theninput y;datalines;A 1A 2B 3;run;What is the output?

  1. No observations

  2. x y {A 1} {A 2} {B 2}

  3. x y {A 1} {A 2}

  4. x y {A 1} {A 2} {B .}

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

The SAS DATA step uses line-hold specifier @ to hold the current record. For 'A' records, it reads the next line/value y. For the 'B' record, it doesn't execute the inner input for y, causing y to remain missing (.) for that observation. The output contains observations for A (1), A (2), and B (.).