Note: On the live exam,
you will be evaluated both on the results of your code and the code
itself. Your code should be similar to the following example code,
but does not need to match exactly :
footnote 'Printed on
%sysfunc(today(),worddate.)'; /*1*/
%macro test (dsn=, vars=); /*2*/
proc print data=&dsn;
where begin_date=21774;
var &vars;
run;
%mend test; /*3*/
%test(dsn=certadv.all, vars=course_code fee); /*4*/
1 |
The %SYSFUNC function executes
the SAS function TODAY and formats the value Worddate. using the macro
facility. |
2 |
The %MACRO statement defines the
macro Test, which accepts the keyword parameters Vars and Dsn. The
macro generates a PROC PRINT step. |
3 |
The %MEND statement ends the macro
definition of Test. |
4 |
The %test statement calls the macro
Test with a Dsn parameter value of Certadv.All and
Vars parameter values of Course_Code and Fee .
When executed, it generates a PROC PRINT step that reads the Certadv.All
data set and prints only the columns Course_Code and Fee. |
Output 17.5 PROC PRINT of Certadv.All (partial output)