SAS 9.4 Programming Fundamentals A00-215 Exam Practice Test

Page: 1 / 14
Total 78 questions
Question 1

How many statements are In the program shown below?



Answer : B

In the provided program, there are six distinct SAS statements:

data FemaleStudents; - Data step beginning

set sashelp.Class; - Set statement

where Sex='F'; - Where statement

Classroom='Red Room'; - Assignment statement

run; - Run statement to execute the data step

title 'Female Students in Red Room'; - Title statement

Note that the proc print and the second run; statement are part of another PROC step to print the results and hence are not counted in this particular count. The final title; statement is used to clear the title setting and does not count as part of the program statements being asked about.


SAS 9.4 Language Reference: Concepts, 'DATA Step'

SAS documentation on 'TITLE Statement'

Question 2

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 3

The following program is summited:

The following report is created:

However, the desired report is shown below:

What change is needed to display the desired formatted values for the Answer varia



Answer : C

When defining custom formats in SAS, it's important to adhere to the correct syntax, which includes ending format names with a period. In the submitted program, the format $convert is defined without a period at the end of the format name in the VALUE statement. This is likely causing an error since format names in the VALUE statement should always end with a period. Option C correctly identifies that adding a period to the end of the format name on the VALUE statement will allow SAS to properly recognize and apply the custom format to the Answer variable when the PROC PRINT step is executed.

The program provided in the question seems to have formatting errors, but based on the information provided, the suggested change is to add a period to make it $convert. which would correctly apply the format.

The other options would not resolve the issue of applying the custom format:

A . Changing the case of the unformatted values will not help if the format is not correctly specified.

B . The comma does not seem to be the issue based on the context given.

D . The dollar sign is correct and necessary for character formats; removing it would cause the format to be invalid for character data.


SAS 9.4 documentation for the FORMAT procedure: SAS Help Center: PROC FORMAT

Question 4

Given the code shown below:

What will be the format for MSRP in the RPOC PRINT output?



Answer : B

The FORMAT statement in the DATA step assigns formats to variables for the SAS dataset being created. In the code provided, MSRP is given the dollar12. format and Invoice is given the dollar10. format. However, during the PROC PRINT step, MSRP is reassigned to the comma12.2 format. The format specified in the most recent PROC step or DATA step that executes is the one that is used in the output.

Therefore, the format for MSRP in the PROC PRINT output will be comma12.2, making the answer: B. Comma12.2


SAS documentation on PROC PRINT and FORMAT statement, SAS Institute.

Question 5

What is the default sort order of PROC SORT?



Answer : B

https://documentation.sas.com/?docsetId=proc&docsetTarget=n12jw1r2n7auqqn1urrh8jwezk00.htm&docsetVersion=9.4&locale=en#:~:text=ASCENDING%20is%20the%20default%20sort%20order.&text=In%20a%20PROC%20SORT%20KEY,is%20sorted%20in%20ascending%20order.

The default sort order for PROC SORT in SAS is ascending. This means that if no other sort order is specified, SAS will arrange the data in ascending order based on the values of the variable(s) listed in the BY statement.

Here's an example:

proc sort data=mydata; by variable; run; sorts mydata by variable in ascending order by default.

The other options are incorrect in the context of the default sort order:

A . 'Internal' is not a sort order.

C . 'Formatted' refers to sorting data based on formatted values, not the default order.

D . 'Descending' is an alternative sort order that must be explicitly specified with the DESCENDING keyword.


SAS 9.4 documentation for the PROC SORT statement: [SAS Help Center: PROC SORT]

Question 6

Given the following code:

Which variables are created with the BY statement?



Answer : A

In SAS, when you use a BY statement in a DATA step, SAS creates two temporary variables for each variable listed in the BY statement: one to indicate the first occurrence (FIRST.variable) and another to indicate the last occurrence (LAST.variable) of the value within the BY-group. Given the provided code and assuming that State is the variable used in the BY statement, SAS will create First.State and Last.State. Thus, option A is correct.


SAS documentation on the BY statement, SAS Institute.

Question 7

Which statement is true about SAS program syntax?



Answer : C

In SAS program syntax, character strings are indeed case sensitive when enclosed in quotation marks. If you compare two character strings of the same letters but different cases, SAS will treat them as different values. For example, 'Hello' is not the same as 'hello'.

Option A is incorrect because the ampersand (&) is not used for comments in SAS; it is used for macro variable references. Option B is incorrect because global statements such as LIBNAME and options do not require a RUN statement to execute. Finally, option D is incorrect because SAS can process steps with multiple statements on the same line, provided that they are correctly separated by semicolons.

Reference

SAS 9.4 Language Reference: Concepts, 'SAS Language Elements and Syntax.'


Page:    1 / 14   
Total 78 questions