Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which of the following
statements is false?
-
A macro variable can
be defined and referenced anywhere in a SAS program except within
data lines.
-
Macro variables are
always user-defined, and their values remain constant until they are
changed by the user.
-
Macro variables are
text strings that are independent of SAS data sets.
-
The values of macro
variables can be up to 65,534 characters long.
-
Which of the following
TITLE statements correctly references the macro variable
month
?
-
title "Total Sales for '&month' ";
-
title "Total Sales for 'month'";
-
title "Total Sales for &month";
-
title Total Sales for "&month";
-
Which of the following
statements generates an error message while trying to display the
value of the macro variable
month
in the SAS log?
-
-
-
-
%PUT the macro variable MONTH has the value &month.;
-
Which statement creates
a macro variable named
location
that has the value
storage
?
-
-
-
%let location = "storage";
-
-
What value do these
statements assign to the macro variable
reptitle
:
%let area = "Southeast";
%let reptitle = * Sales Report for &area Area *;
-
Sales Report
for Southeast Area
-
Sales Report
for "Southeast" Area
-
*Sales Report
for "Southeast" Area*
-
* Sales
Report for "Southeast" Area *
-
Assuming that you began
your SAS session today, which of the following statements correctly
sets the macro variable
currdate
to today's
date:
-
%let currdate = %sysfunc(today(), worddate.);
-
%let currdate = &sysdate9;
-
%let currdate = %sysfunc(date());
-
-
Macro character functions
-
can be used to manipulate
character strings in macro variable values.
-
have the same basic
syntax as the corresponding DATA step functions and yield similar
results.
-
-
-
The four types of tokens
that SAS recognizes are
-
expressions, literals,
names, and special characters.
-
literals, names, numbers,
and special characters.
-
expressions, names,
numbers, and special characters.
-
expressions, literals,
numbers, and special characters.
-
What are the resulting
values for the macro variables that are defined here?
%let month1 = June;
%let month2 = July;
%let period1 = &month1&month2;
%let period2 = May&month1;
%let period3 = &month2.Aug;
-
month1
Junemonth2
Julyperiod1
June
Julyperiod2
May
Juneperiod3
July
Aug
-
month1
Junemonth2
Julyperiod1
JuneJulyperiod2
MayJuneperiod3
July.Aug
-
month1
Junemonth2
Julyperiod1
JuneJulyperiod2
MayJuneperiod3
JulyAug
-
month1
Junemonth2
Julyperiod1
junejulyperiod2
Mayjuneperiod3
julyaug
-
Which of the following
correctly produces a title in which the current date is left-justified
in order to remove extra blanks?
-
title "Report for %sysfunc(left(%sysfunc(today(),worddate.)))";
-
title "Report for %sysfunc(left(today(), worddate.))";
-
title "Report for %sysfunc(left(%qsysfunc(today(), worddate.)))";
-
title "Report for %left(today(), worddate.))";