I am reminded of the famous quote from an engineer. "Sure I can idiot-proof this design. How big of an idiot do you want me to proof it against?" My first response is to suggest that all your macro parameters have default values. %macro Demo(data=sashelp.class,var=age); The macro runs with no parameters and the user is already aware of the expected values, e.g. that data is a two-level name. My next suggestion is to examine the assumption(s) that an unassigned mvar is indeed worthy of concern. Here is a sas community org wiki page on assertions. Assertions - sasCommunity This page has a number of reality checks for existence of various objects, data, var, catalog, etc.. http://www.sascommunity.org/wiki/Conditionally_Executing_Global_Statements My solution is to write my macros to do nothing gracefully. Ron Fehd testing-aware programs maven Writing Testing Aware Programs - sasCommunity ... and, of course, being an introvert, I thought of a couple more comments to add
* Here is a macro with the code for checking existence of various objects.
http://www.sascommunity.org/wiki/Macro_Exist
* from a design perspective, what you are doing by adding the parm-check macro to any other macro
is changing
from a subroutine which calls no other macros to complete its task
to a routine which raises the level of complexity of your test suites.
Message was edited by: Ronald Fehd, Friday morning May 1.
... View more