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
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 */