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 (December 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 9 Dec 2009 16:38:21 +0000
Reply-To:   Ruben van den Berg <ruben_van_den_berg@hotmail.com>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Ruben van den Berg <ruben_van_den_berg@hotmail.com>
Subject:   Re: Can I remove a macro within a session?
In-Reply-To:   <OF099192D8.7B7A07B2-ON86257687.004CD4E1-86257687.004DDEDA@us.ibm.com>
Content-Type:   multipart/alternative;

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!

Ruben

Date: Wed, 9 Dec 2009 08:10:30 -0600 From: oliverr@us.ibm.com Subject: Re: Can I remove a macro within a session? To: SPSSX-L@LISTSERV.UGA.EDU

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. begin data 1 2 end data. set mprint on. define !mymacro() var1 !enddefine. freq var=!mymacro. define !mymacro() var2 !enddefine. freq var=!mymacro. set mprint off.

From: Bruce Weaver <bruce.weaver@hotmail.com>

To: SPSSX-L@LISTSERV.UGA.EDU

Date: 12/09/2009 07:50 AM

Subject: Re: Can I remove a macro within a session?

Sent by: "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> > > !enddefine. > > !function. > > Is there any command to 'UNdefine' a macro in SPSS so I can get rid of the > suffixes? > > > TIA! >

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?

----- -- Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "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 SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

_________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop


[text/html]


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