Multiple choice technology programming languages

Data A; x = 1; y = 3; z = 6; output; x = 2; y = 4; output; Run; Data B; Set A; z = x*y; where z < 6; Run; What will be the output of data set B?

  1. 2 observations

  2. 0 observations

  3. 1 observation

  4. Error

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

Dataset A has 2 observations (x=1,y=3,z=6 and x=2,y=4,z is not set). When reading into B, we compute z=x*y. For first obs: 1*3=3, but WHERE z<6 filters it out. For second obs: 2*4=8, also filtered out. Result: 0 observations meet the WHERE condition.