Will some one help me out in writing a macro code.
While generating a report in PDF format you normally write a SAS code which includes titles and foot notes also.How do you write a macro code for titles and foot notes exclusively such that when you run the SAS code(which does not include titles and foot notes) along with the macro (which contains the code for titles and footnotes),the combined output should reflect titles and foot notes also.
From there, you should be able to see, or figure out, what you want to do yourself.
The universal thing to do is not use a macro and just use the title and footnote statements directly themselves. Otherwise, you will just create an overly complicated wrapper that doesn't simplify anything.
Like I just wrote in another thread.
KISS -- keep it simple ...
macro's are meant to simplify and condense/modularize reusable code.
Like %getID and %getPassword(%getID)
Where %getID is
and %getPassword retrieves a user's password from a secure table, which consumes a number of lines of code.
Another way I use a macro is for database access.
I have a macro that has all the pieces to access our MOM data warehouse. I use it in two ways:
1) in an include file that has the following line
libname MOM oledb %MOMdb ;
2) to facilitate pass-through SQL
connect to oledb as momdb (%momdb) ;
disconnect from momdb;
%momdb returns all of the datasource=, provider=, user=, password=, schema= and prompt=no bits and pieces, providing a single point of maintenance should something have to change.
Now it would be useless for me to write a generic universal %momdb statement for you to use because the bits and pieces would be different. Same goes for a common title and footer thingy.