SAS Report Generation & Output 2 — Questions and Answers
Question 1: Which ODS statement closes all currently open ODS destinations in a single step?
- ODS ALL CLOSE
- ODS CLOSE
- ODS _ALL_ CLOSE (Correct answer)
- ODS DESTINATIONS CLOSE
Correct answer: ODS _ALL_ CLOSE
ODS _ALL_ CLOSE closes all currently open ODS destinations simultaneously, using the SAS convention of underscores around special keywords.
Question 2: In PROC REPORT, the DEFINE statement with the GROUP usage creates output where:
- Each observation appears on a separate row
- Observations with the same value are consolidated into one row (Correct answer)
- Variable values are displayed across multiple columns
- Aggregate statistics are calculated without grouping
Correct answer: Observations with the same value are consolidated into one row
The GROUP usage in a DEFINE statement consolidates all observations sharing the same variable value into a single row, similar to a BY-group summary.
Question 3: Which option in PROC REPORT directs output to the current ODS destination instead of opening an interactive Report window?
- NOREPORT
- NOWINDOWS (Correct answer)
- LISTING
- NODELAY
Correct answer: NOWINDOWS
The NOWINDOWS option in PROC REPORT prevents the interactive Report window from opening and sends output to the active ODS destination instead.
Question 4: In the PROC TABULATE TABLE statement, which operator separates the row expression from the column expression?
- Asterisk (*)
- Plus (+)
- Slash (/)
- Comma (,) (Correct answer)
Correct answer: Comma (,)
The comma (,) in the TABLE statement separates table dimensions: the first comma separates the page dimension from rows, and the second separates rows from columns.
Question 5: Which ODS destination generates Portable Document Format output suitable for printing and sharing?
- ODS RTF
- ODS HTML
- ODS PDF (Correct answer)
- ODS DOCUMENT
Correct answer: ODS PDF
ODS PDF generates output in Portable Document Format, creating fixed-layout files readable by Adobe Acrobat and compatible viewers.
Question 6: The BREAK statement in PROC REPORT with the SUMMARIZE option inserts a row that:
- Suppresses all subtotals for the group
- Contains summary statistics for the observations in each report group (Correct answer)
- Splits the report across multiple pages
- Defines a new computed variable for the group
Correct answer: Contains summary statistics for the observations in each report group
The SUMMARIZE option in the BREAK statement inserts a summary row containing aggregate statistics for each group defined by a GROUP variable.
Question 7: The TITLE statement in SAS defines text that:
- Applies only to the immediately following procedure
- Persists across procedures until changed or cancelled with a null TITLE statement (Correct answer)
- Applies only to ODS HTML and PDF destinations
- Can only be specified once per SAS program
Correct answer: Persists across procedures until changed or cancelled with a null TITLE statement
The TITLE statement persists across all subsequent procedures until it is redefined or cancelled by a null TITLE statement (TITLE;).
Which ODS statement closes all currently open ODS destinations in a single step?