Introduction
Welcome to Edition 18 of Making SAS Accessible to Everyone. This edition is a knowledge check. It features a quiz to reinforce your understanding of key concepts from Editions 1 through 8, covering:
- Basic SAS syntax and data manipulation
- Data step processing and PDV
- Data exploration and formatting
Each section includes multiple-choice and true/false questions. Answers and explanations follow at the end.
1. Multiple Choice Questions
Q1. Which SAS procedure is used to preview the first few observations in a dataset?
A. PROC UNIVARIATE
B. PROC CONTENTS
C. PROC PRINT
D. PROC MEANS
Q2. What does the PDV (Program Data Vector) do during DATA step execution?
A. Stores entire datasets in memory
B. Holds one observation at a time during processing
C. Compiles summary statistics
D. Filters data rows before output
Q3. Which SAS format displays numeric values as percentages?
A. DATE9.
B. DOLLAR8.2
C. PERCENT8.
D. COMMA.
Q4. In the DATA step, what happens if you omit the RUN; statement?
A. The program crashes immediately
B. SAS auto-detects the end of step when another step starts
C. Nothing happens, the code is ignored
D. It becomes a comment
Q5. Which PROC gives you both mean and standard deviation of numeric variables?
A. PROC PRINT
B. PROC CONTENTS
C. PROC MEANS
D. PROC FREQ
Q6. Which statement is used to filter observations during execution?
A. WHERE
B. SELECT
C. FORMAT
D. CLASS
Q7. What is the purpose of OBS=n in PROC PRINT?
A. Hides the observation numbers
B. Limits the output to n rows
C. Sorts data in ascending order
D. Saves the result in a new dataset
Q8. What does the NODUPKEY option in PROC SORT do?
A. Removes observations with missing values
B. Exports the dataset as a CSV file
C. Removes duplicate observations based on key variables
D. Converts numeric to character variables
Q9. What type of variables is required for PROC UNIVARIATE analysis?
A. Character
B. Categorical
C. Numeric
D. Date
Q10. Which operator is used to match a pattern in a WHERE clause?
A. BETWEEN
B. LIKE
C. MATCHES
D. CONTAINS
2. True or False Questions
Q11. The WHERE statement can be used in both DATA and PROC steps.
True / False
Q12. The PROC SORT step must be followed by a BY statement.
True / False
Q13. The PDV is built during the execution phase of the DATA step.
True / False
Q14. The FORMAT statement modifies how values are stored in the dataset.
True / False
Q15. PROC UNIVARIATE can help identify outliers.
True / False
Q16. PROC FREQ is used to generate frequency tables for numeric variables only.
True / False
Q17. The LABEL statement can only be used inside PROC PRINT.
True / False
Q18. You can use macro variables inside a FORMAT statement.
True / False
Q19. The TITLE statement allows macro variable expansion.
True / False
Q20. PROC MEANS requires you to specify all variables using a VAR statement.
True / False
Answers & Explanations
Q1. C. PROC PRINT
Used to preview raw observations.
Q2. B. Holds one observation at a time during processing
The PDV is a temporary storage area where one observation is built.
Q3. C. PERCENT8.
Displays numbers multiplied by 100 and adds a % symbol.
Q4. B. SAS auto-detects the end of step when another step starts
SAS interprets the next DATA or PROC step as the boundary.
Q5. C. PROC MEANS
Provides summary statistics including mean, min, max, and std dev.
Q6. A. WHERE
Used to subset rows based on logical conditions.
Q7. B. Limits the output to n rows
Restricts the number of rows printed to the specified value.
Q8. C. Removes duplicate observations based on key variables
Only one observation is kept for each unique BY-group.
Q9. C. Numeric
PROC UNIVARIATE is designed for numeric variables.
Q10. B. LIKE
Allows pattern matching using wildcards % and _.
Q11. True
The WHERE clause is versatile and can filter in both contexts.
Q12. False
You can sort without BY; it’s needed only for specifying sort order.
Q13. False
The PDV is constructed during the compile phase.
Q14. False
FORMAT changes how data is displayed, not stored.
Q15. True
PROC UNIVARIATE provides detailed statistics, including outlier detection.
Q16. False
PROC FREQ can be used for both categorical and numeric values.
Q17. False
LABEL can be used in DATA steps and many procedures.
Q18. True
You can reference macro variables to dynamically set formats.
Q19. True
Macro variables can be resolved within TITLE statements.
Q20. False
If VAR is omitted, PROC MEANS uses all numeric variables by default.
In Edition 19, we will continue with another round of quiz questions focused on Editions 9 to 13.
Stay sharp and keep learning with 3 D Statistical Learning!
With sincere thanks to Dr. Dany Djeudeu for fostering confidence in SAS programming.
We help businesses and researchers solve complex challenges by providing expert guidance in statistics, machine learning, and tailored education.
Our core services include:
– Statistical Consulting:
Comprehensive consulting tailored to your data-driven needs.
– Training and Coaching:
In-depth instruction in statistics, machine learning, and the use of statistical software such as SAS, R, and Python.
– Reproducible Data Analysis Pipelines:
Development of documented, reproducible workflows using SAS macros and customized R and Python code.
– Interactive Data Visualization and Web Applications:
Creation of dynamic visualizations and web apps with R (Shiny, Plotly), Python (Streamlit, Dash by Plotly), and SAS (SAS Viya, SAS Web Report Studio).
– Automated Reporting and Presentation:
Generation of automated reports and presentations using Markdown and Quarto.
– Scientific Data Analysis:
Advanced analytical support for scientific research projects.