SAS 9.4 Programming Fundamentals A00-215 Exam Questions

Page: 1 / 14
Total 78 questions
Question 1

Given the following SAS program:

What footnotes appear for the second PROC PRINY report?



Answer : D

In SAS, footnotes are set using the footnote statement and they will appear on all subsequent output until they are either changed or cleared. Based on the second image provided with the SAS code, the footnote for the second PROC PRINT report is set immediately before it runs.

The code sets footnote1 as 'Created by HR' and footnote2 as 'Confidential' initially. However, before the second PROC PRINT step, footnote2 is redefined as 'Draft - Do Not Distribute'. Since footnote1 is not redefined or cleared, it is no longer in effect for the second report.

Therefore, the only footnote that appears for the second PROC PRINT report is what is defined for footnote2 at that point in the code, which is 'Draft -- Do Not Distribute'. That's why the correct answer is D.


SAS 9.4 documentation for the FOOTNOTE statement: SAS Help Center: FOOTNOTE Statement

Question 2

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 3

Which PROC MEANS step generates the report below?



Answer : A

The correct syntax for generating the mean and standard deviation for specified variables using PROC MEANS is shown in option A. The PROC MEANS statement specifies the dataset to analyze (data=class) and includes the options (mean std) directly in the PROC statement. The VAR statement then lists the variables for which the statistics should be calculated (Height and Weight). The other options listed in B, C, and D are not correct syntax for PROC MEANS.


Question 4

When the following code is submitted, execution fails.

Why does the execution fail?



Answer : C


Question 5

Given the display of the CITIES data set:

Which program creates the PROC PRINT report below?



Answer : B

The PROC PRINT statement is used for printing SAS datasets. To customize the column headers in the report, you use the label statement within the PROC PRINT procedure to assign new labels to variables, and the label option in the PROC PRINT to activate these labels. The noobs option suppresses the printing of observation numbers in the report.

Option B has the correct syntax for what is being requested:

proc print data=cities label noobs; specifies the dataset to print with the label option to display variable labels and noobs to hide the observation numbers.

label Name='Employee Name' City='Birth City'; assigns the label 'Employee Name' to the 'Name' variable and 'Birth City' to the 'City' variable.

run; signifies the end of the PROC PRINT procedure.

Options A, C, and D are incorrect due to syntax errors:

A uses an incorrect option showlabelse instead of label and noobs.

C is incorrect because it lacks the label option in the proc print statement which is necessary to actually display the labels, and the labels are being incorrectly used within the proc print instead of in a label statement.

D has several issues: there is no display statement in SAS, the option noobs should be outside of the proc print statement, and the labels should be defined in a label statement, not within proc print.


SAS 9.4 documentation for the PROC PRINT statement: SAS Help Center: PROC PRINT

Question 6

Which line contains a syntax error?



Answer : A

In the provided code snippet, Line 3 contains a syntax error. The keep statement is used incorrectly here; the correct keyword to use is where in order to filter the dataset. The correct line should be something like:

where Make = 'Honda';

So, the keep statement on Line 3 is not properly used, and also there appears to be a missing quotation mark at the end of 'Honda' which should be closed before the semicolon.


SAS documentation for the where statement.

Question 7

Which statement is true regarding a DATA step concatenation?



Answer : B

In a DATA step concatenation in SAS, when multiple datasets are listed in a SET statement, SAS concatenates the datasets vertically, stacking them one on top of the other. The length of variables in the resulting dataset is determined by the first dataset that appears in the SET statement. If the same variable appears in multiple datasets, SAS uses the length as it is first encountered. It does not require columns with the same name to be renamed; rather, it stacks them directly. There is no maximum number of tables that can be listed in a SET statement for concatenation; more than two can be concatenated. Lastly, concatenation combines data vertically, not horizontally as option D suggests.

Reference

SAS 9.4 Language Reference: Concepts, 'Concatenating Data Sets.'


Page:    1 / 14   
Total 78 questions