nerdexam
SAS_Institute

A00-280 · Question #52

The following SAS program is submitted, but fails due to syntax errors: data WORK.TOTALEXPEND (keep=MonthExp(12)); set WORK.MONTHLYEXPEND (keep=Year Drug Disp); array MonthExp(12); do i=1 to 12…

The correct answer is C. An array cannot be referenced in a keep= data set option. See the full explanation below for the reasoning.

Question

The following SAS program is submitted, but fails due to syntax errors: data WORK.TOTALEXPEND (keep=MonthExp(12)); set WORK.MONTHLYEXPEND (keep=Year Drug Disp); array MonthExp(12); do i=1 to 12; MonthExp(i)=Disp; end; drop i; run; What is the cause of the syntax errors?

Options

  • AThe keep= data set option should be (keep=MonthExp').
  • BAn array can only be referenced in a KEEP statement and not within a keep= data set option.
  • CAn array cannot be referenced in a keep= data set option.
  • DThe keep= data set option should be (keep=MonthExp).

How the community answered

(40 responses)
  • A
    5% (2)
  • B
    15% (6)
  • C
    73% (29)
  • D
    8% (3)

Community Discussion

No community discussion yet for this question.

Full A00-280 Practice