Chapter Quiz 6

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in

the appendix.

1. Which PROC PRINT step below creates the sample output with the labels and

variables being displayed? Hint: PROC CONTENTS output is shown first to assist

you.

a. proc print data=cert.laguardia noobs;

var on changed flight;

where on>=160;

run;
b. proc print data=cert.laguardia;

var date on changed flight;

where changed>3;

run;

c. proc print data=cert.laguardia label;

id date;

var boarded transferred flight;

label boarded='On' transferred='Changed';

where flight='219';

run;

d. proc print cert.laguardia noobs;

id date;

var date on changed flight;

where flight='219';

run;

2. Which of the following PROC PRINT steps is correct if labels are not stored with the

data set?

a. proc print data=cert.totals label;

label region8='Region 8 Yearly Totals';

run;

b. proc print data=cert.totals;

label region8='Region 8 Yearly Totals';

run;

c. proc print data cert.totals label noobs;

run;

d. proc print cert.totals label;


run;

3. Which of the following statements selects from a data set only those observations for

which the value of the variable Style is RANCH, SPLIT, or TWOSTORY?

a. where style='RANCH' or 'SPLIT' or 'TWOSTORY';

b. where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';

c. where style in (RANCH, SPLIT, TWOSTORY);

d. where style in ('RANCH','SPLIT','TWOSTORY');

4. If you want to sort your data and create a temporary data set named Calc to store the

sorted data, which of the following steps should you submit?

a. proc sort data=work.calc out=finance.dividend;

run;

b. proc sort dividend out=calc;

by account;

run;

c. proc sort data=finance.dividend out=work.calc;

by account;

run;

d. proc sort from finance.dividend to calc;

by account;

run;
5. Which of the following statements can you use in a PROC PRINT step to create this

Output?

a. var month instructors;

sum instructors aerclass walkjogrun swim;

b. var month;

sum instructors aerclass walkjogrun swim;

c. var month instructors aerclass;

sum instructors aerclass walkjogrun swim;

d. all of the above

6. What happens if you submit the following program?

proc sort data=cert.diabetes;

run;

proc print data=cert.diabetes;

var age height weight pulse;

where sex='F';
run;

a. The PROC PRINT step runs successfully, printing observations in their sorted

order.

b. The PROC SORT step permanently sorts the input data set.

c. The PROC SORT step generates errors and stops processing, but the PROC

PRINT step runs successfully, printing observations in their original (unsorted)

order.

d. The PROC SORT step runs successfully, but the PROC PRINT step generates

errors and stops processing.

7. If you submit the following program, which output does it create?

proc sort data=cert.loans out=work.loans;

by months amount;

run;
A, preguntar él porque

8. Which statement below selects rows that satisfy both these conditions?

• The amount is less than or equal to $5000.

• The account is 101-1092 or the rate equals 0.095.

a. where amount <= 5000 and


account='101-1092' or rate = 0.095;

b. where (amount le 5000 and account='101-1092')

or rate = 0.095;

c. where amount <= 5000 and

(account='101-1092' or rate eq 0.095);

d. where amount <= 5000 or account='101-1092'

and rate = 0.095;

9. What does PROC PRINT display by default?

a. PROC PRINT does not create a default report; you must specify the rows and

columns to be displayed.
b. PROC PRINT displays all observations and variables in the data set. If you want

an additional column for observation numbers, you can request it.

c. PROC PRINT displays columns in the following order: a column for observation

numbers, all character variables, and all numeric variables.

d. PROC PRINT displays all observations and variables in the data set, a column

for observation numbers on the far left, and variables in the order in which they

occur in the data set. Preguntar ¿?

You might also like