SAS_Institute
A00-212 · Question #37
The following SAS program is submitted: data temp; set sasuser.history(keep = date); format date qtr.; <insert BY statement here> if first.date then total = 0; total + 1; if last.date; run; proc…
The correct answer is D. by groupformat date. See the full explanation below for the reasoning.
Question
The following SAS program is submitted:
data temp; set sasuser.history(keep = date); format date qtr.; <insert BY statement here> if first.date then total = 0; total + 1; if last.date; run; proc print data = temp; run; SASUSER.HISTORY is sorted by the SAS date variable DATE. The following output is required:
date total ---- ---- 1 13 2 12 3 15 4 25 Which By statement completes the data step and successfully generates the required output?
Options
- Aby date qtr.;
- Bby notsorted date;
- Cby formatted date;
- Dby groupformat date;
How the community answered
(32 responses)- A6% (2)
- B19% (6)
- C3% (1)
- D72% (23)
Community Discussion
No community discussion yet for this question.