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. |
52.15.210.12