SAS 9.4 Programming Fundamentals A00-215 Exam Practice Test

Page: 1 / 14
Total 78 questions
Question 1

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 2

Given the PROC PRINT report of the INVEST data set shown below:

How many observations are in the FORCAST data set after this program executes?



Answer : B

The FORCAST dataset is created from the INVEST dataset, which has 10 observations as seen in the PROC PRINT report. For each observation in INVEST, three new observations are added in FORCAST, one for each year's balance calculation (year=1, year=2, year=3). This is achieved by the output; statement after each balance calculation, which writes the current state of the data step to a new row in the dataset. Therefore, since there are 10 original observations, and each leads to three new observations, the total number of observations in the FORCAST dataset will be 30 (10 observations from INVEST multiplied by 3 years each).


SAS documentation on the DATA step and output statement, SAS Institute.

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

Which statement is true about the DROP statement during the compilation phase of the DATA step?



Answer : A

The DROP statement during the compilation phase of the DATA step flags variables in the Program Data Vector (PDV) to be dropped when the data set is output. This means that although the variables exist in the PDV during the DATA step execution, they will not be written to the output data set. The DROP statement does not affect the order of variables (which is the purpose of the ORDER= data set option), nor does it remove variables from the input data set or prevent them from being created in the PDV.


SAS documentation on the DROP statement.

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

Which statement is true regarding a variable?



Answer : A

In SAS, character variables are indeed capable of holding alphabetic characters, numeric digits, and other special characters, which makes Option A the correct answer. This flexibility allows for storing a wide range of data as text, including combinations that may include symbols and numbers typically found in addresses, identification codes, or textual data that includes special characters. Unlike numeric variables, character variables do not interpret the data as numbers but as literal strings of characters. Options B, C, and D contain inaccuracies regarding how data types and values are treated in SAS. Specifically, numeric values in SAS are never enclosed in quotes (which contradicts B), character variables can exceed 200 bytes depending on the specific declaration (contradicting C), and while numeric variables can indeed include numbers, decimal points, minus signs, and scientific notation, they do not typically include currency symbols as part of the variable's numeric value (contradicting D).

Reference: SAS documentation on data types, SAS Institute.


Question 7

Which LABEL statement has correct syntax?



Answer : B

In SAS, the correct syntax for assigning labels to variables is to use the LABEL statement within a DATA step or a PROC step. Labels are assigned to variables using the format variable='label'. The correct syntax for the LABEL statement is represented by option B.

Here's the breakdown:

FName='First Name' correctly assigns the label First Name to the variable FName.

LName='Last Name' correctly assigns the label Last Name to the variable LName.

Each variable and label pair is separated by a space, and the overall statement ends with a semicolon, which is the proper syntax for a LABEL statement in SAS.

Options A, C, and D are incorrect due to various syntax errors like the use of the wrong character for the apostrophe, missing apostrophes, incorrect punctuation, and in the case of option C, an incorrect conjunction 'and' which is not used in LABEL statements.


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

Page:    1 / 14   
Total 78 questions