EZ Study

Actuarial Biology Chemistry Economics Calculators Confucius Engineer
Physics
C.S.

SAS Programing Certification Exam
Practice Questions & Answer set-5

Practice Question 18

The SAS data set WORK.AWARDS is listed below:
fname points
Amy 2
Amy 1
Gerard 3
Wang 3
Wang 1
Wang 2

The following SAS program is submitted:
proc sort data = work.awards;
by descending fname points;     run;
Which one of the following represents how the observations are sorted?
A. Wang 3
Gerard 3
Wang 2
Amy 2
Wang 1
Amy 1

B. Wang 3
Wang 2
Wang 1
Gerard 3
Amy 2
Amy 1

C. Wang 3
Wang 1
Wang 2
Gerard 3
Amy 2
Amy 1

D. Wang 1
Wang 2
Wang 3
Gerard 3
Amy 1
Amy 2

Answer: D The sort order is descending fname and ascending points.

Practice Question 19

The observations in the SAS data set WORK.TEST are ordered by the values of the variable SALARY.
The following SAS program is submitted:
proc sort data = work.test out = work.testsorted;

by name; run;
Which one of the following is the result of the SAS program?
A. The data set WORK.TEST is stored in ascending order by values of the NAME variable.
B. The data set WORK.TEST is stored in descending order by values of the NAME variable.
C. The data set WORK.TESTSORTED is stored in ascending order by values of the NAME variable.
D. The data set WORK.TESTSORTED is stored in descending order by values of the NAME variable.

Answer: C. The data set WORK.TESTSORTED is stored in ascending order by values of the NAME variable

Practice Question 20

Which one of the following statements is true regarding the name of a SAS array?
A. It is saved with the data set.
B. It can be used in procedures.
C. It exists only for the duration of the DATA step.
D. It can be the same as the name of a variable in the data set.

Answer: C SAS Array exists only for the duration of the DATA step

Practice Question 21

The following SAS program is submitted:
data stats;     set revenue;     array weekly{5} mon tue wed thu fri;
Click to Get Those Highly Recommended SAS Programmers' Books
\< do statement here \>;     total = weekly{i} * .25;    
output;     end;     run;
Which one of the following DO statements completes the program and processes the elements of the WEEKLY array?
A. do i = 1 to 5;
B. do weekly{i} = 1 to 5;
C. do i = mon tue wed thu fri;
D. A DO loop cannot be used because the variables referenced do not end in a digit.

Answer: A
Related links:

Continue to SAS Practice Exam Question Answer Set-6   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-4   SAS Tutorial   Statistics Tutorial