1.5 Flashcards
Which of the following is false regarding the TITLE statement?
a) TITLE is a global statement that establishes a title for all reports created in your SAS session
b) The syntax is TITLE “title-text”;
c) You can have unlimited title lines.
d) You specify a number after the keyword TITLE to indicate the line number of the title.
e) TITLE and TITLE1 are equivalent.
c) You cannot have unlimited TITLE lines. You can have up to 10 lines of titles.
Which syntax below will clear a predefined TITLE statement?
a) TITLE clear;
b) TITLE “New Title”;
c) TITLE
d) TITLE;
d)TITLE;
Which of the following will turn off the default titles in SAS procedures?
a) ODS NOPROCTITLE;
b) ODS NOTITLE;
c) NOPROCTITLE;
d) noproctitle option in the PROC step
a) ODS NOPROCTITLE;
True/False - The following code will run without error, filter the proc report by age and indicate the age filter in the title.
%let age = 13;
title “Class Report”;
title2 “Age=&age”;
proc print data=pg1.class_birthdate;
where age=&age;
run;
title;
True - when referencing a macro variable in a title, you must enclose the macro variable in double quotation marks so that SAS replaces the macro variable with the stored text.
Which of the following PROC steps will show the specified column labels on the report?
proc means data=sashelp.cars;
where type=”Sedan”;
var MSRP MPG_Highway;
label MSRP=”Manufacturer Suggested Retail Price”
MPG_Highway=”Highway Miles per Gallon”;
run;
proc print data=sashelp.cars;
where type=”Sedan”;
var MSRP MPG_Highway;
label MSRP=”Manufacturer Suggested Retail Price”
MPG_Highway=”Highway Miles per Gallon”;
run;
a) Both the PROC MEANS and PROC PRINT reports will include the column labels.
b) Only the PROC MEANS report will include the column labels
c) Only the PROC PRINT report will include the column labels
d) Neither of the PROC steps will generate reports with column labels
b) Only the PROC MEANS step.
The PROC MEANS, PROC FREQ, and most other procedures automatically display the labels in the results, but PROC PRINT is an exception. Because the main purpose of PROC PRINT is to examine the data, column names are displayed by default. To display labels instead, you must add the LABEL option in the PROC PRINT statement.
proc print data=sashelp.cars label;
where type=”Sedan”;
var MSRP MPG_Highway;
label MSRP=”Manufacturer Suggested Retail Price”
MPG_Highway=”Highway Miles per Gallon”;
run;
Which statement can be used to segment a report based on the unique values of one or more columns?
a) WHERE
b) GROUP
c) BY
d) IN
c) BY - You can use the BY statement in a reporting procedure to segment a report based on the unique values of one or more columns. To do this, you must sort the data first using the same BY-column.
Which of the statements below is true?
a) Adding a label statement to either a PROC or DATA step will permanently create the label.
b) Adding a label statement to a DATA step permanently creates a label, while adding a label to the PROC step creates only a temporary label.
c) Adding a label statement to a PROC step permanently creates a label, while adding a label to the DATA step creates only a temporary label.
d) Labels are always temporary and must be re-specified in each step.
b) Adding a label statement to a DATA step permanently creates a label, while adding a label to the PROC step creates only a temporary label.
Which statement will generate a table showing the number of distinct values in the PROC FREQ step below?
proc freq data=pg1.storm_final;
tables BasinName Season;
run;
a) FREQ
b) LEVELS
c) NLEVELS
d) None of the above
c) NLEVELS - The NLEVELS option added an NLEVELS table at the top of the report. It indicates that for the column BasinName, there were six unique values, and for Season, there were 38.
Which of the following will generate a report that sorts unique values of each column by descending frequency?
a) proc freq data = mydata order=freq; tables BasinName Season; run; b) proc freq data = mydata descending; tables BasinName Season; run; c) proc sort data = mydata; by descending BasinName descending Season; run;
a) proc freq data = mydata order=freq;
tables BasinName Season;
run;
True/False - When you place an asterisk between two columns in the TABLES statement, PROC FREQ produces a two-way frequency, or cross-tabulation report.
True
Which of the following statements will remove the row and column percentages from the report and just include frequency counts?
a) tables BasinNameStartDate / norow nocol nopercent;
b) tables BasinNameStartDate / norow nocol nocum;
c) tables BasinNameStartDate / nopercent;
d) tables BasinNameStartDate / norow nocol nopercent nocum;
a) tables BasinName*StartDate / norow nocol nopercent;
What does the CROSSLIST option do in the PROC FREQ step?
a) Displays row and column scores
b) Includes all possible combinations of variable levels in an output table
c) Displays crosstabulation tables in ODS column format
d) Displays two-way to n-way tables in a list format
c) Displays crosstabulation tables in ODS column format
What does LIST option do in the PROC FREQ step?
a) Displays row and column scores
b) Includes all possible combinations of variable levels in an output table
c) Displays crosstabulation tables in ODS column format
d) Displays two-way to n-way tables in a list format
d) Displays two-way to n-way tables in a list format
Which statement do you use to group data in a PROC MEANS procedure?
a) GROUP
b) BY
c) TABLES
d) CLASS
d) The CLASS statement enables you to name one of more columns to group the data. And then statistics are calculated for each unique value of the CLASS columns. When you have more than one CLASS column, you can use the WAYS statement to control the combination of values of the Class columns.
True/False - The following procedure will generate only the mean and median values of the MaxWindMPH variable.
proc means data=pg1.storm_final;
var MaxWindMPH / mean median;
run;
False - The correct syntax is:
proc means data=pg1.storm_final mean median;
var MaxWindMPH;
run;