EZ Study

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

SAS Programing Certification Exam
Practice Questions & Answer set-6

Practice Question 22

The following SAS program is submitted:

data work.test;
array agents{4} $ 12 sales1 - sales4; run;
Which one of the following represents the variables that are contained in the output data set?

A. SALES1, SALES2, SALES3, SALES4
B. AGENTS1, AGENTS2, AGENTS3, AGENTS4
C. None, the DATA step fails because the ARRAY statement can reference only numeric data.
D. None, the DATA step fails because the ARRAY statement can reference only pre-existing variables.

Answer: A In this datastep the array is creating 4 character variable sales1-sales

Practice Question 23

The following SAS program is submitted:

data work.test;
set work.staff (keep = jansales febsales marsales);
array diff_sales{3} difsales1 - difsales3;
Click to Get Those Highly Recommended SAS Programmers' Books
array monthly{3} jansales febsales marsales; run;

Which one of the following represents the new variables that are created?
A. JANSALES, FEBSALES and MARSALES
B. MONTHLY1, MONTHLY2 and MONTHLY3
C. DIFSALES1, DIFSALES2 and DIFSALES3
D. DIFF_SALES1, DIFF_SALES2 and DIFF_SALES3

Answer: C Tricky, the name of the array diff_sales and the variables mentioned difsales1 - difsales3 look similar but with different spellings.

Practice Question 24

On which portion(s) of a SAS data set does the PRINT procedure report?
A. the data portion only
B. the descriptor portion only
C. the descriptor portion and the data portion
D. neither the data portion nor the descriptor portion

Answer: A The Proc Print reports on the data portion only. Use Proc Contents to get the descriptor portio

Practice Question 25

Which one of the following SAS procedures displays the data portion of a SAS data set?
A. PRINT     B. FSLIST     C. CONTENTS     D. DATASETS

Answer: A

Practice Question 26

The following SAS program is submitted:

proc datasets lib = sasuser;
contents data = class varnum;
quit;

Which one of the following is the purpose of the VARNUM option?

A. to print a list of variable names
B. to print the total number of variables
C. to print a list of the variables in alphabetic order
D. to print a list of the variables in the order they were created

Answer: D Print a list of the variables by their position in the data set. By default, the CONTENTS statement lists the variables alphabetical .

Related links:

Continue to SAS Practice Exam Question Answer Set-7   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-5   SAS Tutorial   Statistics Tutorial