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 about the %INCLUDE statement is correct?
-
It can be used to insert
the contents of an external file into a program.
-
It causes a macro definition
that is stored in an external file to be compiled when the contents
of that file are inserted into a program and submitted.
-
It can be specified
with the SOURCE2 option in order to write to the SAS log the contents
of the external file that is inserted into a program.
-
-
What happens if you
store a macro definition in a SAS catalog SOURCE entry?
-
The macro definition
can be submitted for compilation by using the FILENAME and %INCLUDE
statements.
-
The SOURCE entry will
be deleted at the end of the session.
-
You do not need to compile
the macro before you invoke it in a program.
-
-
Which of the following
programs correctly sets the appropriate system options and calls the
macro Prtlast? Assume that Prtlast is stored in an autocall library
as a text file and that it has not been compiled during the current
SAS session.
-
libname mylib 'c:mylib';
filename macsrc 'mylib.macsrc';
options mautosource sasautos=(macsrc, sasautos);
%prtlast
-
libname mylib 'c:mylib';
filename macsrc catalog 'mylib.macsrc';
%prtlast
-
filename mylib 'c:mylib';
options mautosource sasautos=(sasautos,mylib);
%prtlast
-
libname mylib 'c:mylib';
options mautosource sasautos=mylib;
%prtlast
-
When you submit the
following code, what happens?
%macro prtlast;
proc print data=&syslast (obs=5);
title "Listing of &syslast data set";
run;
%mend;
-
A session compiled macro
named Prtlast is stored in Work.Sasmacr.
-
A macro named Prtlast
is stored in the autocall library.
-
The Prtlast macro is
stored as a stored compiled macro.
-
The Prtlast macro is
stored as a SOURCE entry in a permanent SAS catalog.
-
Why would you want to
store your macros in external files?
-
You could easily share
your macros with others.
-
You could edit your
macros with any text editor.
-
Your macros would be
available for use in later SAS sessions.
-
-
Which of the following
is not true?
-
The autocall macro facility
stores compiled SAS macros in a collection of external files called
an autocall library.
-
Autocall libraries can
be concatenated together.
-
One disadvantage of
the autocall facility is that the first time you call an autocall
macro in a SAS session, the macro processor must use system resources
to compile it.
-
The autocall facility
can be used with the stored compiled macro facility.
-
Suppose you had the
program below, and you wanted to concatenate the values from the libname
and memname columns to create a call to %Report3 for each row of data
read. Which option would correctly run the program below and generate
a result?
data _null_;
set sashelp.vtable;
where libname='MC1' and memtype='DATA';
rc=_______________________;
run;
-
rc=dosubl(cats('%Report3(',catx(',',libname,memname),')'));
-
rc=dosubl(catx(%Report3(',catx(',',libname,memname),')'));
-
rc=dosubl(catx(%Report3,',libname,memname),')');
-
rc=dosubl(cats(%Report3,',libname,memname),')');
-
When does the DOSUBL
function execute the text string?
-
The function executes
the text string during the compilation phase.
-
The function executes
the text string immediately.
-
The function does not
execute the text string. The text string is stored as a macro.
-
The function executes
the text string, but does not return any values.