Dear Bruce and Richard,
The example below runs fine indeed. I'll have to check my journal file to see exactly which syntax generated these errors and see to what extent I can replicate them. Perhaps something else than defining an existing macro has been the source of all the misery.
Thanks a lot for your advice!
Date: Wed, 9 Dec 2009 08:10:30 -0600
Subject: Re: Can I remove a macro within a session?
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 <email@example.com>
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 been
> 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 same
> suffix to the macro call but I find this somewhat inefficient. I'd rather
> 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 the
Hi Ruben. This is odd. I redefine macros all the time without altering the
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: http://old.nabble.com/Can-I-remove-a-macro-within-a-session--tp26708500p26710320.html
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
New Windows 7: Find the right PC for you. Learn more.