EZ Study

Actuarial Biology Chemistry Economics Calculators Confucius Engineer

SAS Programing Certification Exam
Practice Questions & Answer set-16

Practice Question 73

When would you use a CLASS statement?

A) The CLASS statement is used to sort data in a defined structure
B) The CLASS statement is used to define and group observations
C) The CLASS statement is used when applying a specified statistic to
a group of observations
D) The CLASS statement is used when a table must be created

Answer: C Reasoning: The CLASS statement will allow statistics to be applied to a group of observations.
As a result of this statement, the data would be sorted, grouped and displayed in a single table; but is not the primary reason for using the CLASS statement.

Practice Question 74

In order to sequentially read multiple records to create a single observation,
what condition must be in place to succeed?

A) The records must be in free format.
B) Variables have to be specified explicitly
C) The #n line pointer has to be specified
D) The number of observations for each record must be the same

Answer: D Reasoning: The only correct answer is that the number of observations for each record must be the same.

Practice Question 75

When is the best time to use the DROP= statement?

A) Only when used with the KEEP= statement
B) Only when a variable should not be processed
C) When the variable should not appear in the data set
D) Never

Answer: C Reasoning: DROP= and KEEP= can be used independently from each other. Whether the DROP= statement appears in the same statement as the DATA or SET statement will determine if the variable will be processed or not. In all cases though, the variable will not appear in the data set.

Practice Question 76

Which of the following conditions should discourage the use of the one-toone
readings to combine data sets?
A) When a better method is available
B) All observations from each data set read should be contained in the final data set
C) All variables from each data set read should be contained in the final data set
D) Variables have the same name in multiple data sets

Answer: B Reasoning: One-to-one readings are the simplest form of combining data sets which will provide the best option in ensuring the programming code is not overly complex. In this type of combining, all the variables from each of the data sets will exist in the new data set. Variables with the same name does not matter, since the values of the last data set read will overwrite all previous values from existing data sets. If the values should not be overwritten, the variable name can be changed before the output is rendered. Not all observations will appear in the final data set: if this is a requirement than concatenation is the next best choice for combining data sets.

Practice Question 77

Which of the following is true about performance testing of DATA steps?
A) Performance testing cannot be done on data steps
B) A data set is created during performance testing
C) The Num. of observations can be limited using OBS= in FILENAME statement
D) Conditions can be placed in the performance testing to enable value testing

Answer: D Reasoning: Performance testing can be done on data steps by putting a NULL in the DATA step.
Click to Get Those Highly Recommended SAS Programmers' Books
This will prevent a data set from being created. The number of observations can be limited by putting the OBS= option in the INFILE statement. Conditions can be set using IF/THEN ELSE statements to test for values.

Practice Question 78

Which of the following statements is true about column inputs of data?

A) Once a field is read, the data step cannot come back to it
B) Should not be used to read nonstandard numeric data
C) All fields have to be read sequentially
D) Missing data must have a placeholder in the form of a period

Answer: B Reasoning: Column input is used when data fields are fixed. In this situation, the columns can be read in any order and re-read if necessary. Missing data does not require a placeholder either. Unfortunately, only standard data should be read using column input: nonstandard data should utilize the formatted input.

Practice Question 79

Which of the statements below is incorrect?
A) SAS will read and execute steps simultaneously
B) A step is completed when the QUIT statement appears
C) All programming steps begin with either a DATA or PROC keyword
D) A step is completed when the RUN statement appears

Answer: A Reasoning: Programming steps begin with DATA or PROC and end with either QUIT or END. SAS steps are completely read before executing.

Related links:

Continue to SAS Practice Exam Question Answer Set-17   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-15   SAS Tutorial   Statistics Tutorial