A Modern Software Design Principle Applied To SAS Macro Programming: The Inversion Of Control Concept


The inversion of control (IoC) architectural concept is a programming principle commonly used in object oriented programming.  The basic concept is to implement high-level (in relation to the level of abstraction) source code more reusable by making it independent from low-level, problem-specific code. Program flow and thus control is inverted by using a callback approach which means that code on a lower abstraction layer calls code defined at a higher abstraction layer. This is an inversion of the program flow direction used in traditional procedural programming. The big advantage of IoC is that you get more reusable code, that you decouple your code and thus have less risk of side-effects when you change your code. The usage of the IoC principle is not limited to object oriented programming. This article points out how to apply IoC to SAS macro programming with an actual example and how to benefit from its advantages.


Dr. Patrick Warnat, computer scientist for medical informatics, senior software engineer and project manager at HMS Analytical Software.


Download complete paper.