Practice for the SAS advance certification exam.
A %MACRO statement must always be paired with a %MEND statement.
A macro definition can include macro variable references, but it cannot include SAS language statements.
Only macro language statements are checked for syntax errors when the macro is compiled.
Compiled macros are stored in a temporary SAS catalog by default.
Rate this question:
%macro print(vars, total); proc print data=classes; var vars; sum total; run; %mend print;
%macro print('vars', 'total'); proc print data=classes; var &vars; sum &total; run; %mend print;
%macro print(vars, total); proc print data=classes; var &vars; sum &total; run; %mend print;
%macro print(vars, total); proc print data=classes; var :vars; sum :total; run; %mend print;
Rate this question:
%printdsn(sasuser.courses, course_title days);
%printdsn(dsn=sasuser.courses, vars=course_title days)
%printdsn(sasuser.courses, course_title days)
%printdsn(sasuser.courses, course_title, days)
Rate this question:
You must list positional parameters before any keyword parameters.
Values for both positional and keyword parameters are stored in a local symbol table.
Default values for keyword parameters are the values that are assigned in the macro definition, whereas positional parameters have a default value of null.
You can assign a null value to a keyword parameter in a call to the macro by omitting the parameter from the call.
Rate this question:
A macro program is compiled when you submit the macro definition.
A macro program is executed when you call it (%macro-name).
A macro program is stored in a SAS catalog entry only after it is executed.
A macro program is available for execution throughout the SAS session in which it is compiled.
Rate this question:
You must place %DO and %END statements around code that describes the conditional action, if that code contains multiple statements.
The %ELSE statement is optional.
You cannot refer to DATA step variables in the logical expression of the %IF statement.
All of the above.
Rate this question:
Only whole steps.
Only whole steps or whole statements.
Only whole statements or pieces of text within a statement.
Whole steps, whole statements, or pieces of text within statements.
Rate this question:
data _null_; set sasuser.courses; %let class=course_title; run;
data _null_; set sasuser.courses; call symput('class', course_title); run;
%macro sample(dsn); %local class; %let class=course_title; data_null_; set &dsn; run; %mend;
%global class; %macro sample(dsn); %let class=course_title; data _null_; set &dsn; run; %mend;
Rate this question:
%macro hex(start=1, stop=10, incr=1); %local i; data _null_; %do i=&start to &stop by &incr; value=&i; put "Hexadecimal form of &i is " value hex6.; %end; run; %mend hex;
%macro hex(start=1, stop=10, incr=1); %local i; data _null_; %do i=&start %to &stop %by &incr; value=&i; put "Hexadecimal form of &i is " value hex6.; %end; run; %mend hex;
%macro hex(start=1, stop=10, incr=1); %local i; data _null_; %do i=&start to &stop by &incr; value=&i; put "Hexadecimal form of &i is " value hex6.; run; %mend hex;
%macro hex(start=1, stop=10, incr=1); %local i; data _null_; %do i=&start to &stop by &incr; value=&i; put "Hexadeciaml form of &i is " value hex6.; %end run; %mend hex;
Rate this question:
First, the macro processor checks all macro programming statements in the macro for syntax errors. Then the macro processor executes all statements in the macro.
he macro processor executes compiled macro programming statements. Then any SAS programming language statements are executed by the macro processor.
First, all compiled macro programming statements are executed by the macro processor. After all macro statements have been processed, any SAS language statements are passed back to the input stack in order to be passed to the compiler and then executed.
The macro processor executes compiled macro statements. If any SAS language statements are encountered, they are passed back to the input stack. The macro processor pauses while those statements are passed to the compiler and then executed. Then the macro processor continues to repeat these steps until it reaches the %MEND statement.
Rate this question:
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.