As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Macro Functions: How to Make Them - How to Use Them

From sasCommunity
Jump to: navigation, search


The SAS® macro language includes a number of macro functions, such as %UPCASE, %QSCAN, and %SUBSTR. In addition a number of Autocall macros, such as %LEFT, %TRIM, and %VERIFY, are also supplied that act like macro functions. Macro functions are especially useful as programming tools, because the function call is replaced directly by the result of the call. Many macro programmers are unaware that they too can write useful macro functions.

Fortunately macro functions are not difficult to program. Not difficult, that is, if you know the simple techniques required to turn a macro into a macro function. This paper shows you how to create a macro function, the statements that you must avoid, and the technique used to “pass” the result of the function back to the calling program.

Online Materials

View the pdf for this paper.
You can down load the files associated with this Hands-on-Workshop:

Contact Info

Please check out my user page. You can also email me.