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 (July 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 15 Jul 2010 13:46:59 -0400
Reply-To:     Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject:      Re: Macro error
Comments: To: Dan Boisvert <daniel.boisvert@GENZYME.COM>

On Thu, 15 Jul 2010 11:27:00 -0400, Dan Boisvert <daniel.boisvert@GENZYME.COM> wrote: ... >CALL SYMPUT does not create the macro variable until after the data step has >run. You just need to split this into two separate data steps.

Hi, Dan, This is one of the things that are often misunderstood. The symput call routine can create a macro variable (if not already exists in the scope) during the data step's run time. Once created, then you can retrieve the value immediately as well. You don't have to wait until the data step is done running as demonstrated below. HTH. Cheers, Chang

%symdel mvar;

data _null_; length var $10; var = "nothing"; put "before " var; call symput("mvar", "something"); var = symget("mvar"); put "after " var; run; /* before nothing after something */


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