LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 25 Jun 2009 12:38:56 -0700
Reply-To:     xlr82sas <xlr82sas@AOL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         xlr82sas <xlr82sas@AOL.COM>
Organization: http://groups.google.com
Subject:      Is it possible to update the calling macro's symbol table from
              within the called macro
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

I was wondering if version 9.2 will allow direct updates to the various symbol tables. Maybe peek and poke to some special addresses in the symbol table?

The point is to avoid global macro variables.

This works

note macvar exits in the parent macro symbol table but is not global

%macro child(dummy=a);

/* dummy so that macro builds symbol table */ /* lots of programming statements */

data _null_; call symput('macval4','1234');

%mend child;

%macro parent(dummy=b);

%child; run; /* run is critical */ %put &macval4; /* this outputs 1234 */ %mend parent;

%parent; %put &macval4; /* this outputs &macval4 - so we have not created a global macro variable */


Back to: Top of message | Previous page | Main SAS-L page