SAS A00-215 SAS 9.4 Programming Fundamentals Exam Practice Test

Page: 1 / 14
Total 78 questions
Question 1

Which two statements are true about data set options such as KEEP= and RENAME =? (Choose two.)



Answer : A, D

Data set options in SAS, such as KEEP= (to specify variables to keep in a dataset) and RENAME= (to change the names of variables in a dataset), have specific rules for their usage:

A . The options must be placed in parentheses - This is correct. When specifying dataset options in SAS, they must be enclosed in parentheses immediately following the dataset name, without any spaces in between.

D . The options are placed after the data set name - This is also correct. Dataset options follow the dataset name and are enclosed in parentheses to modify how SAS reads or writes the dataset in that step.

Option B is incorrect because data set options are allowed in both DATA and PROC steps, provided they are relevant to the procedure being used. Option C is incorrect because data set options can be applied to both input and output datasets, depending on the context and specific operation being performed.


Question 2

Which statement is true about the SUM statement?



Answer : C

The SUM statement in SAS is used to sum values across observations, adding the value of the expression on the right side of the statement to the variable on the left. It does not use an equal sign (eliminating A), only one variable can be on the left-hand side of a SUM statement (eliminating B), and it is not initialized to 1 by default (eliminating D). What makes the SUM statement particularly useful is that it ignores missing values when summing across observations, which means that missing values do not affect the sum (option C is correct).


SAS documentation on the SUM statement, SAS Institute.

Question 3

Which PROC SORT statement specifies the sort variable?



Answer : B

The PROC SORT statement that specifies the sort variable is: BY

The BY statement in PROC SORT is used to specify the variable(s) by which the data should be sorted.


Question 4

The SAS log of a submitted DATA step is shown below:

Which action resolve the error messages?



Answer : B

The error messages in the SAS log indicate issues with the treatment of text as a character string. In SAS, character strings must be enclosed in quotation marks. The log shows that 'ABC Inc.' is treated as if it is a variable or an expression, which is causing a syntax error. Enclosing 'ABC Inc.' in quotation marks will correctly identify it as a character string. Therefore, Option B is the correct action to resolve the error messages. This error is evident as the log indicates it was expecting an arithmetic operator, which suggests that the text was misinterpreted as part of an expression.


SAS documentation on character strings and data step options, SAS Institute.

Question 5

Fill in blank

What is the default byte size of a numeric variable?

Thedefault lengthofnumeric variablesin SAS data sets is ______bytes

Enter your numeric answer in the space above.



Answer : A

Thedefault lengthofnumeric variablesin SAS data sets is 8bytes.

In SAS, the default byte size of a numeric variable is 8 bytes. This allows for a significant amount of precision and a wide range of numeric values to be stored within a numeric variable, regardless of the actual number of digits in the number being stored.


SAS documentation on numeric variables, SAS Institute.

Question 6

What type of error does NOT produce the expected results and does NOT generate errors or warnings in the log?



Answer : B

The type of error that does not produce expected results and does not generate errors or warnings in the log is a logic error. Logic errors occur when there is a flaw in the program's logic, which causes it to operate incorrectly, but the syntax is correct so it does not produce any error or warning messages. Unlike syntax errors which are mistakes in the program's code that prevent it from compiling or running, logic errors are more insidious because the program still runs but yields incorrect results. For example, a programmer may accidentally code an incorrect formula or use a wrong variable name that still exists, so the program runs but produces incorrect output.


SAS documentation on error types.

Question 7

Which PROC PRINT option displays variable labels in the report?



Answer : D

In the PROC PRINT statement, the LABEL option is used to display variable labels in the report. If the variables in the dataset have labels associated with them, the LABEL option will ensure that these labels are used in the output instead of the variable names.

Here's how the LABEL option is used:

proc print data=sashelp.class label; (assuming sashelp.class is the dataset in question)

The LABEL keyword after the dataset name within the PROC PRINT call activates the use of variable labels in the output report.

The other options provided are incorrect for the following reasons:

SHOWLABELS is not a valid SAS option.

COLS does not exist as a PROC PRINT option in SAS.

LABELS= is not a correct syntax for any SAS procedure.


SAS 9.4 documentation for the PROC PRINT statement with LABEL option: [SAS Help Center: PROC PRINT]

Page:    1 / 14   
Total 78 questions