|
Next Meeting:
Date: April 2, 2010
Time: 1:00 – 4:00 pm
Location: UNUM HO3, 2211 Congress Street
Topic: Advanced Macros
Speakers: Ian Whitlock and Victor Pontes
Ian Whitlock, Kennett Square, PA: Advanced Macros Medley
Call Execute - Explained
CALL EXECUTE is a DATA step function for sending a character string to the macro facility for immediate macro execution. The function is important because it provides a simple way to avoid messy macro looping involving SAS data. However, some of consequences provided by this ability are not well documented. The presentation will use examples to go into details entailing a short review of how macro execution depends on the environment invoking the macro.
A Serious Look Macro Quoting
You can make decisions macro with %IF and do looping with %DO-loops. But there are times when you don't understand why the beast does what it does. Now what?
It is time to come to this presentation. It is time to take a serious look at macro quoting. I have often said that anyone who thinks macro quoting is simple, probably doesn't understand the problem; so I have been there. Now I want to explain how simple it is.
Everything relevant to this paper is in BASE SAS®. Although the examples have been executed on a PC under Windows, the examples are independent of any particular operating system with the exception of file definitions.
You might think this paper is a compendium of all the macro quoting functions. It is not. It is more about the subject of macro quoting than about the macro quoting functions.
Recursion in SAS Macro
Various programming languages provide the ability of a function to call itself. Such functions are said to be recursive. In general the technique is important because it can simplify some programming problems.
While the SAS DATA step language is not recursive, the macro language is. This means that a macro can invoke itself. If one is not used to the idea, it seems impossible to make use of such a feature.
Examples will be used to introduce recursion to those not acquainted with the idea.
Biography:
Dr. Ian Whitlock has been programming largely in SAS since 1981. His main interest is in computer languages, particularly SAS, and how the language affects the programming process. He has participated since 1986 in many international, regional, and local SAS User Group meetings. He is also active on SAS-L with some insightful answers to perplexed SAS programmers.
He uses the specialized search engine at www.lexjansen.com/sugi/ to search for all SAS papers and SAS-L messages.
Victor Pontes, Inatec, Inc.:
The Generic Macro
The SAS Macro facility is a powerful tool for automated code generation. Most programmers regularly use Macro programming to add efficiency to Base SAS code generation. But the macro language isn't just for generating Base SAS code; it is used to simplify the production of repetitive Macro code as well. We will explore some of these possibilities using the Generic Macro, which will simplify the production of macro code by taking the code itself as a parameter. Some unusual things happen with the SAS stack when we do this. A little used macro quoting function helps to make it all work.
Biography:
Victor Pontes has spent his entire professional life programming, mostly using SAS but also as an applications programmer. Five years ago he founded Inatec, Inc., through which he works as an independent consultant, primarily in the areas of pharmaceutical and biomedical research.
|