SAS 9.4 Programming Fundamentals A00-215 Exam Questions

Page: 1 / 14
Total 78 questions
Question 1

Which PROC MEANS statement specifies the numeric variables to analyze?



Answer : D

The VAR statement in PROC MEANS is used to specify the variables for which you want to calculate the descriptive statistics such as the mean and standard deviation. You list the names of one or more numeric variables after the VAR statement to include them in the analysis. Therefore, option D is the correct answer.

Reference

SAS documentation for PROC MEANS.


Question 2

Which two correctly create a SAS date value? (Choose two.)



Answer : A, C

To create SAS date values, the correct syntax involves specifying the date in a string format followed by the letter 'd'. This indicates to SAS that the string should be interpreted as a date value. Therefore, the correct answers are:

A . '10/19/2019'd - This format directly specifies the month, day, and year, enclosed in quotes followed by 'd', which SAS correctly interprets as a date value.

C . '19Oct2019'd - This format uses a three-letter abbreviation for the month combined with the day and year, also followed by 'd'. This is another valid way to specify a date in SAS.

Option B, mdy(10, 19, 2019), is incorrect because while the MDY function does create date values from month, day, and year components, the function itself should be used within a DATA step or another context where SAS functions are evaluated, and it doesn't directly create a date literal in the same way as options A and C.

Option D, mdy(19, Oct, 2019), is syntactically incorrect because the MDY function expects numeric arguments for the month, day, and year, and 'Oct' as a literal month name is not a valid numeric argument.


Question 3

Which statement is true regarding the XLSX engine in the LIBNAME statement?



Answer : B

The correct answer is B: The XLSX engine can read and write data in Microsoft Excel workbooks. This functionality allows SAS users to directly access and manipulate data stored in Excel files using the .xlsx extension. The XLSX engine does not automatically concatenate individual worksheets; instead, each worksheet is accessed separately. Also, it specifically works with files that have the .xlsx extension, not the older .xls format, thus eliminating option C. Option D is incorrect because the XLSX engine requires the correct file extension (.xlsx) in the LIBNAME statement to properly identify and interact with Excel files. Reference:

SAS documentation on LIBNAME statement for XLSX engine: SAS Support: LIBNAME Statement


Question 4

Given the SAS data set WORK PRODUCTS:

How many variables does the WORK REVENUE data set contains?



Answer : D

The resulting WORK.REVENUE data set contains 3 variables. In the provided SAS program, the set statement uses a (keep=) option to keep only 3 variables from WORK.PRODUCTS, which are ProdId, Price, and Sales. The drop= data set option in the data statement specifies to drop the Sales and Returns variables from the output data set. However, Returns was not included in the keep= option, so it won't be part of WORK.REVENUE to begin with. Finally, a new variable Revenue is calculated and included in the data set. Therefore, the final data set contains the variables ProdId, Price, and Revenue.


SAS documentation on keep= and drop= data set options.

Question 5

Which step temporarily assign a format to the sales variable?



Answer : D

The 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.


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

Question 6

Given the partial report shown below:

Which step will produce this report?



Answer : D

The report shown is a cross-tabulation of 'Region' by 'Product'. The FREQ Procedure indicates that PROC FREQ has been used, and the presence of 'Frequency', 'Percent', 'Row Percent', and 'Column Percent' suggests that a cross tabulation (or contingency table) has been requested. The correct code for this output would include the tables statement to specify the two variables ('Region' and 'Product') with an asterisk between them, which indicates a request for a cross-tabulation of these two categorical variables, and the crosslist option to display the table in a cross-tabulated list format. Therefore, option D is the correct answer:

proc freq data=sashelp.shoes;

tables region*product / crosslist;

run;

Options A and C use the order=freq option incorrectly, as this option would order the table by frequency counts rather than providing a cross-tabulation. Option B is missing the crosslist option needed to produce the cross-tabulated format.


Question 7

Fill in Blank

Given the following DATA step:

What is the value of average?

The value of average is _____.

Enter your numeric answer in the space above.



Answer : A

In the DATA step provided, average is calculated using the mean function, which calculates the average of the non-missing values of the variables listed. The variables provided are:

var1 = 2

var2 = 4

var3 = .

var4 = 6

The mean function in SAS ignores missing values, represented by a period (.). Hence, the average is computed using the non-missing values (2, 4, and 6). The mean of these three numbers is calculated as: (2 + 4 + 6) / 3 = 12 / 3 = 4

Therefore, the value of average is 4.


SAS documentation on the MEAN function, SAS Institute.

Page:    1 / 14   
Total 78 questions