Macro variables are
always text strings that are independent of SAS data sets. The value
of a macro variable can be up to 65,534 characters long, and the name
of a macro variable can be up to 32 characters long. A macro variable
can be defined or referenced anywhere in a SAS program except within
data lines. There are two types of macro variables: automatic and
user-defined.
Correct answer: c
To reference a macro
variable, you precede the name with an ampersand. You do not need
to enclose the macro variable reference in quotation marks.
Correct answer: a
There are two ways to
display the value of a macro variable in the SAS log: you can turn
on the SYMBOLGEN system option to list the values of all macro variables
that are used, or you can use the %PUT statement to write specific
text, including macro variable values, to the log.
Correct answer: d
You use the %LET statement
to define a macro variable. You do not need to enclose the value in
quotation marks. If you do include quotation marks in the assigned
value for a macro variable, the quotation marks will be stored as
part of the value.
Correct answer: d
Macro variables are
stored as character strings. Quotation marks and most special characters
are stored exactly as they are assigned, but leading blanks are stripped
from assigned values. You can also include references to other macro
variables within %LET statements.
Correct answer: d
SYSDATE9 is an automatic
macro variable that stores the date that your SAS session began in
ddmmmyyyy format. You can use the %SYSFUNC function along with any
DATA step function, so both the TODAY() function and the DATE() function
will result in the current date.
Correct answer: c
Macro character functions
such as %UPCASE and %SUBSTR enable you to perform character manipulations
on your macro variable values.
Correct answer: b
The word scanner recognizes
four types of tokens. Expressions are not a type of token.
Correct answer: c
You can combine macro
variable references with text to create new text strings. If you precede
a macro variable with text, the ampersand at the beginning of the
macro variable name signals the end of the text and the beginning
of a macro variable name. If you want text to follow the macro variable
value, you must signal the end of the macro variable name with a period.
Correct answer: c
You use the %QSYSFUNC
function in this case, in order to mask the comma that results from
the worddate. format. You must mask this comma since the LEFT() function
expects only one argument.