nerdexam
SAS_Institute

A00-201 · Question #61

A raw data file is listed below: ----|----10----|----20----|----30 squash 1.10 apples 2.25 juice 1.69 The following SAS program is submitted using the raw data file above: data groceries; infile…

The correct answer is C. .retain grandtot 0; grandtot = sum(grandtot,cost). See the full explanation below for the reasoning.

Question

A raw data file is listed below: ----|----10----|----20----|----30 squash 1.10 apples 2.25 juice 1.69 The following SAS program is submitted using the raw data file above: data groceries; infile 'file-specification'; input item $ cost; <insert statement(s) here> run; Which one of the following completes the program and produces a grand total for all COST values?

Options

  • A.grandtot = sum cost;
  • B.grandtot = sum(grandtot,cost);
  • C.retain grandtot 0; grandtot = sum(grandtot,cost);
  • D.grandtot = sum(grandtot,cost);

How the community answered

(45 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    82% (37)
  • D
    11% (5)

Community Discussion

No community discussion yet for this question.

Full A00-201 Practice