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


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


SYMPUT and SYMGET: Getting DATA Step Variables and Macro Variables to Share

From sasCommunity
Revision as of 18:04, 9 April 2017 by ArtCarpenter (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Christianna Williams, PhD
The University of North Carolina at Chapel Hill

Abstract

Because one of the most powerful incentives to use the SAS® macro language is to allow SAS programs to be more data-driven, it is critical for the DATA step and the macro facility to "talk" to each other. The SYMPUT routine and the SYMGET function provide two mechanisms to facilitate this communication. Specifically, SYMPUT provides a way to turn DATA step variables into macro variables, and SYMGET does the converse, grabbing macro variable values and assigning them to DATA step variables. The purpose of this tutorial-style paper is to provide several examples of the use of these tools, using the different types of arguments that each accepts, and a few rules that may prevent a headache or two as one starts to write programs in which the DATA step and the macro facility share information. The focus will be on SYMPUT because of its greater utility.

Online resources

View the .pdf of this paper.