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 (August 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Aug 2006 08:44:02 -0400
Reply-To:     Ed Heaton <EdHeaton@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ed Heaton <EdHeaton@WESTAT.COM>
Subject:      Re: assigning a macro variable value to a variable
Comments: To: auto208611@hushmail.com
In-Reply-To:  <1154456311.995184.278020@i42g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"

Otto,

Macro variables contain SAS code. When the DATA step is compiled, the name of the macro variable gets replaced with the SAS code in the macro variable. The SAS code is a constant, it doesn't change during the execution of the DATA step.

Ed

Edward Heaton, SAS Senior Systems Analyst, Westat (An Employee-Owned Research Corporation), 1600 Research Boulevard, RW-4541, Rockville, MD 20850-3195 Voice: (301) 610-4818 Fax: (301) 294-3879 mailto:EdHeaton@Westat.com http://www.Westat.com

-----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of auto208611@hushmail.com Sent: Tuesday, August 01, 2006 2:19 PM To: sas-l@uga.edu Subject: assigning a macro variable value to a variable

I have a macro variable ' j ' that will range from 2 to 13, I try to assign it to a variable within a loop ( within a nested loop, several in fact) but all values for each variable are the same for the 13 observations created in the loop. By using the option symbolgen I know that the value of ' j ' changes at the point I try to assign it to a value for each observation. So I would expect the values of the variable to be different.

This is how I'm currently trying to assign the value of the macro variable to a variable that is not a macro variable:

JNUM = &j ;

Thanks, Otto


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