Here's an example of DEFINING a macro program:
[pre]
options mprint mlogic symbolgen;
%macro prtds(dsn=, limit=10);
proc print data=&dsn (obs=&limit);
title "Print of &limit rows in &dsn";
run;
%mend prtds;
** now look in WORK.SASMACR catalog for the session compiled macro;
[/pre]
Here's how the macro program would be reused:
[pre]
** then reuse the %PRTDS macro program;
%prtds(dsn=sashelp.class, limit=5);
run;
%prtds(dsn=sashelp.prdsale, limit=20);
run;
%prtds(dsn=sashelp.shoes, limit=2);
run;
[/pre]
This book is a good resource
SAS Programming in the Pharmaceutical Industry by Jack Shostak
Also, you can go to Google and type this search string into the Google Search box:
Macro site:www.lexjansen.com/pharmasug
The resulting hits will be of invaluable help. Of course, referring to the SAS Macro facility documentation will help answer your macro questions, too.
cynthia