A00-215 practice question 13 of 15
Which step temporarily assign a format to the sales variable?
Full set: 78 questionsThe correct answer is D. This option uses the PROC PRINT procedure, which is used to print SAS data sets. The format statement within PROC PRINT temporarily assigns a format to a variable for the duration of the PROC PRINT step. Here is how it works: data=sashelp.shoes; tells SAS which dataset to print. Format sales comma12.; temporarily assigns a comma format to the sales variable, making it easier to read, especially if the numbers are large. The comma12. format adds commas for thousands, millions, etc., and displays the number in a field that is 12 characters wide. The format is only applied for the duration of the PROC PRINT step and does not permanently change the dataset. The other options are incorrect for the following reasons:
Option A attempts to use a PROC FORMAT step, which is for creating custom formats, not for assigning formats to variables in a dataset.
Option B uses a DATA step which could permanently assign the format to the sales variable if it were syntactically correct (it should be set sashelp.shoes; instead of Set sashelp,sheoes;).
Option C mentions PROC CONTENTS which displays metadata about variables in a dataset and does not have the capability to assign formats.
Reference: SAS 9.4 documentation for the PROC PRINT statement: SAS Help Center: PROC PRINT
Keep practicing
Take the free A00-215 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other A00-215 practice questions
- Question 1Which statement is true regarding the XLSX engine in the LIBNAME statement?
- Question 2Which ODS EXCEL statement correctly creates an Excel using the ANALYSIS style?
- Question 5Which PROC SORT option allows you to create an output data set of the sorted data?
- Question 6Which LABEL statement has correct syntax?
- Question 8Which PROC PRINT step correctly displays only the first 10 observations in the data set?
- Question 12How does SAS display missing values?
