NJSUG 2009 First Quarter Meeting

We met 9:00am - noon on Friday, March 13 at:

Rutgers Labor Education Center
50 Labor Center Way
Rutgers, The State University of New Jersey
New Brunswick, NJ 08901


11:40- noon

Meeting Registration, gathering and continental breakfast
Iterative Macro Processing with Dynamic Domains (Brian Clawson)
Is This Macro Parameter Blank? (Chang Y. Chung and John King)
Random Access, Door Prizes and Closing Remarks

Iterative Macro Processing with Dynamic Domains


I often found myself spending time creating Macro's in SAS to automate various processes, and then still needing to write and execute additional code every time I went to run the “automated” process. The extra code was to determine what parameters needed to be passed to the Macro given the current state of the data I was working with. I realized that needing to run something to determine parameters prior to running an automated process defeated the purpose of automation.
This paper highlights a method of using Proc SQL in SAS to query a dataset to and dynamically determine the parameters that should be used in a Macro, thereby allowing the entire process to be scheduled, and not depend on human intervention.


Brian Clawson's first introduction to SAS was with MBNA America (now Bank of America) in the Loss Prevention Operations group back in 2002. Brian moved away from SAS, MBNA, and the east coast to San Diego where he worked in the Regional Banking Operations as a Marketing Database Analyst. In 2005 Brian moved back to the east coast with his wife to be and accepted a Risk Management position with Wells Fargo Financial which brought him back to regular use of SAS. Later in 2005 Brian joined Medco Health Solutions where he have been using SAS on a daily basis.

Is This Macro Parameter Blank?


SAS Global Forum 2009 paper; SAS code file (zipped)


The first thing most macros do is checking input parameters. Still, many macro users are unsure when it comes to implementing the parameter checks. This is the case even with the most elementary form, namely the check of the existence of a parameter value, or the "Is-Blank" check. We review and compare various ways to implement it. We then recommend one that performs well given various input parameter values, packaged in a function-style macro %ISBLANK(), which returns 1 when the parameter value is "blank," and 0 otherwise.


Chang Y. Chung is an experienced programmer specialized in statistical programming and data management. He has been using SAS for more than two decades and still enjoys learning new parts of the SAS system. Chang is actively involved in the SAS community both on-line and off-line.

John King is a senior programmer at the Ouachita Clinical Data Services. John has been using SAS for a long time and expert in SAS, data management, and statistical programming. When he is not giving his expert advice on SAS programming, he enjoys engaging in conversations on how to make the SAS user community better for the beginners and experts alike.