Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
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.
-
proc print data=cert.laguardia noobs;
var on changed flight;
where on>=160;
run;
-
proc print data=cert.laguardia;
var date on changed flight;
where changed>3;
run;
-
proc print data=cert.laguardia label;
id date;
var boarded transferred flight;
label boarded='On' transferred='Changed';
where flight='219';
run;
-
proc print cert.laguardia noobs;
id date;
var date on changed flight;
where flight='219';
run;
-
Which of the following
PROC PRINT steps is correct if labels are not stored with the data
set?
-
proc print data=cert.totals label;
label region8='Region 8 Yearly Totals';
run;
-
proc print data=cert.totals;
label region8='Region 8 Yearly Totals';
run;
-
proc print data cert.totals label noobs;
run;
-
proc print cert.totals label;
run;
-
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
?
-
where style='RANCH' or 'SPLIT' or 'TWOSTORY';
-
where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
-
where style in (RANCH, SPLIT, TWOSTORY);
-
where style in ('RANCH','SPLIT','TWOSTORY');
-
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?
-
proc sort data=work.calc out=finance.dividend;
run;
-
proc sort dividend out=calc;
by account;
run;
-
proc sort data=finance.dividend out=work.calc;
by account;
run;
-
proc sort from finance.dividend to calc;
by account;
run;
-
Which of the following
statements can you use in a PROC PRINT step to create this output?
-
var month instructors;
sum instructors aerclass walkjogrun swim;
-
var month;
sum instructors aerclass walkjogrun swim;
-
var month instructors aerclass;
sum instructors aerclass walkjogrun swim;
-
-
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;
-
The PROC PRINT step
runs successfully, printing observations in their sorted order.
-
The PROC SORT step permanently
sorts the input data set.
-
The PROC SORT step generates
errors and stops processing, but the PROC PRINT step runs successfully,
printing observations in their original (unsorted) order.
-
The PROC SORT step runs
successfully, but the PROC PRINT step generates errors and stops processing.
-
If you submit the following
program, which output does it create?
proc sort data=cert.loans out=work.loans;
by months amount;
run;
proc print data=work.loans noobs;
var months amount payment;
sum amount payment;
where months<360;
run;
-
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.
-
where amount <= 5000 and
account='101-1092' or rate = 0.095;
-
where (amount le 5000 and account='101-1092')
or rate = 0.095;
-
where amount <= 5000 and
(account='101-1092' or rate eq 0.095);
-
where amount <= 5000 or account='101-1092'
and rate = 0.095;
-
What does PROC PRINT
display by default?
-
PROC PRINT does not
create a default report; you must specify the rows and columns to
be displayed.
-
PROC PRINT displays
all observations and variables in the data set. If you want an additional
column for observation numbers, you can request it.
-
PROC PRINT displays
columns in the following order: a column for observation numbers,
all character variables, and all numeric variables.
-
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.