Multiple choice technology programming languages

data work.january; set work.allmonths(keep = product month num_sold cost); if month='Jan' then output work.january; sales = cost * num_sold; keep = product sales; run; which variable does the work.january dataset contain?

  1. product and sales only

  2. product month num_sold cost

  3. product sales month num_sold cost

  4. An incomplete output dataset is created due to syntax errors

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

The code has syntax errors: (1) KEEP statement format 'keep = product sales' is incorrect - should be 'KEEP product sales' or used as KEEP= option in SET statement. (2) The KEEP keyword conflicts with SAS statement. (3) IF/OUTPUT syntax issues. These errors prevent dataset creation.