You should be able to redefine a macro within a session without any
problems. As Bruce Weaver notes, a warning used to be issued, but that
didn't prevent the macro from changing.
data list free / var1 var2.
set mprint on.
define !mymacro() var1 !enddefine.
define !mymacro() var2 !enddefine.
set mprint off.
Bruce Weaver <firstname.lastname@example.org>
12/09/2009 07:50 AM
Re: Can I remove a macro within a session?
"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
Ruben van den Berg wrote:
> Dear all,
> I'm writing a macro but it seems I can't use a name that has already
> defined as a macro; I get
> Error # 6802 in column 1024. Text: (End of Command)
> The DEFINE command must begin with the name of the macro being defined.
> Something other than a valid macro name was found.
> This command not executed.
> So each time I modify the macro, I append a suffix to it and add the
> suffix to the macro call but I find this somewhat inefficient. I'd
> write something like
> delete !function.
> define ! function ()
> <blah blah>
> Is there any command to 'UNdefine' a macro in SPSS so I can get rid of
Hi Ruben. This is odd. I redefine macros all the time without altering
name. E.g., I make a first draft of the macro, try it out, and realize I
need to revise something, and so on. My recollection is that in earlier
versions of SPSS, I would get a warning message if I defined a macro that
was using an already existing macro name, but it allowed me to proceed. At
some point (v15 maybe?) the warning message no longer appeared. What
version are you running?
"When all else fails, RTFM."
NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
View this message in context:
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command