Delete macro - macro name

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete macro - macro name

Samir Omerovic
Hi to all again,

 

I have question regarding Macros in SPSS. I have made macro using DEFINE command (explained to me
through this email list, which I am in debt forever). I would like to delete the macro or its name
using syntax. Is there a way to do it?

 

Best regards to all

 

Samir

 

 

GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.

 

Samir Omerović

Researcher

 

71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina

 

 

Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com

 

 

 

-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------

 
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Hal 9000
What is the problem that you are trying to fix?
I wonder if what you mean to say is that you only want to run the macro
under certain circumstances. -Gary


On 1/11/07, Samir Omerović <[hidden email]> wrote:

>
> Hi to all again,
>
>
>
> I have question regarding Macros in SPSS. I have made macro using DEFINE
> command (explained to me
> through this email list, which I am in debt forever). I would like to
> delete the macro or its name
> using syntax. Is there a way to do it?
>
>
>
> Best regards to all
>
>
>
> Samir
>
>
>
>
>
> GfK BH
>
> Centar za istrazivanje trzista i javnog mnijenja d.o.o.
>
>
>
> Samir Omerović
>
> Researcher
>
>
>
> 71 000  Sarajevo, Skenderija 44
>
> Bosna i Hercegovina
>
>
>
>
>
> Tel: +387 33 550 300
>
> Fax: +387 33 444 226
>
> www.gfk.ba
>
> www.gfk.com
>
>
>
>
>
>
>
> -----------------------------------------
>
> This e-mail (and any attachment/s) contains confidential and/or privileged
> information. If you are
> not the intended recipient (or have received this e-mail in error) please
> notify the sender
> immediately  and destroy this e-mail.  Any unauthorized copying,
> disclosure or distribution of the
> material in this e-mail is strictly forbidden.
>
> Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba
> naznacena kao primalac
> molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku.
> Neautorizirano kopiranje,
> objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.
>
> ---------------------------------------
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Samir Omerovic
Hi Gary,

 

The problem is actually in the output. As I said I have made macro using DEFINE command which I use
to produce large quantity of tables using just few syntaxes. If I for some reason need to run the
syntax again (and that happens often) I got the following text

 

>Warning # 6804 in column 3.  Text: V4 -(THIS IS THE NAME OF THE MACRO I CREATED)

>The macro name specified on the DEFINE command duplicates the name of a

>previously defined macro.  This instance will take precedence.

 

I understand why this happens and I understand that I can simply delete it and think of it no
further but I was wondering if I can delete macro name through syntax so when I run it again I do
not get this message, well... it would save me some time.

 

Samir

 

 

 

  _____  

From: Hal 9000 [mailto:[hidden email]]
Sent: Thursday, January 11, 2007 9:10 PM
To: Samir Omerović; [hidden email]
Subject: Re: Delete macro - macro name

 

What is the problem that you are trying to fix?

I wonder if what you mean to say is that you only want to run the macro under certain circumstances.
-Gary

 

On 1/11/07, Samir Omerović <[hidden email]> wrote:

Hi to all again,



I have question regarding Macros in SPSS. I have made macro using DEFINE command (explained to me
through this email list, which I am in debt forever). I would like to delete the macro or its name
using syntax. Is there a way to do it?



Best regards to all



Samir





GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.



Samir Omerović

Researcher



71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina





Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com







-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------



 
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Marta García-Granero
Hi Samir

SO> The problem is actually in the output. As I said I have made
SO> macro using DEFINE command which I use
SO> to produce large quantity of tables using just few syntaxes.
SO> If I for some reason need to run the
SO> syntax again (and that happens often) I got the following text

>>Warning # 6804 in column 3.  Text: V4 -(THIS IS THE NAME OF THE MACRO I CREATED)
>>The macro name specified on the DEFINE command duplicates the name of a
>>previously defined macro.  This instance will take precedence.

SO> I understand why this happens and I understand that I can
SO> simply delete it and think of it no
SO> further but I was wondering if I can delete macro name
SO> through syntax so when I run it again I do
SO> not get this message, well... it would save me some time.

No, MACROs can't be erased from memory. to avoid the error message,
you can either:

1) "Wrap" your MACRO definition with this lines:

PRESERVE.
SET ERRORS=NONE.

DEFINE...

(you MACRO comes here)

!ENDDEFINE.

RESTORE.

2) Separate in two different files the MACRO definition from the MACRO
call. You run the MACRO definition only once, and, since the MACRO
will remain active until you close SPSS, you can close that file. Then
you run any times you want the file(s) with the MACRO calls.

I use both methods with my students: we have a file called
"MACROS.sps" with the macros they are going to use frequently during
class. Anyway, as they insist on INSERTing the file any time they are
going to call a MACRO (they forget they already activated them), I
have added "PRESERVE. SET ERRORS=NONE." and "RESTORE." to the
beginning and end of the MACROS definition file to avoid the error
message (you can argue it would be better to tell my students not to
run the MACROS definition file more than once, but after years of
telling them again and again, I surrendered and added the output flow
control lines to the file, just for my sanity sake).





--
Regards,
Dr. Marta García-Granero,PhD           mailto:[hidden email]
Statistician

---
"It is unwise to use a statistical procedure whose use one does
not understand. SPSS syntax guide cannot supply this knowledge, and it
is certainly no substitute for the basic understanding of statistics
and statistical thinking that is essential for the wise choice of
methods and the correct interpretation of their results".

(Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind)
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Spousta Jan
In reply to this post by Samir Omerovic
Hi Samir,

Before the session, run

set mxwarns = 0.

which suppresses all warnings. The drawback is that you will not get even useful warnings, of course.

After having finished this, you can restore the defaults by

set mxwarns = 10.

Have a nice weekend

Jan

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Samir Omerović
Sent: Friday, January 12, 2007 8:34 AM
To: [hidden email]
Subject: Re: Delete macro - macro name

Hi Gary,



The problem is actually in the output. As I said I have made macro using DEFINE command which I use to produce large quantity of tables using just few syntaxes. If I for some reason need to run the syntax again (and that happens often) I got the following text



>Warning # 6804 in column 3.  Text: V4 -(THIS IS THE NAME OF THE MACRO I
>CREATED)

>The macro name specified on the DEFINE command duplicates the name of a

>previously defined macro.  This instance will take precedence.



I understand why this happens and I understand that I can simply delete it and think of it no further but I was wondering if I can delete macro name through syntax so when I run it again I do not get this message, well... it would save me some time.



Samir







  _____

From: Hal 9000 [mailto:[hidden email]]
Sent: Thursday, January 11, 2007 9:10 PM
To: Samir Omerović; [hidden email]
Subject: Re: Delete macro - macro name



What is the problem that you are trying to fix?

I wonder if what you mean to say is that you only want to run the macro under certain circumstances.
-Gary



On 1/11/07, Samir Omerović <[hidden email]> wrote:

Hi to all again,



I have question regarding Macros in SPSS. I have made macro using DEFINE command (explained to me through this email list, which I am in debt forever). I would like to delete the macro or its name using syntax. Is there a way to do it?



Best regards to all



Samir





GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.



Samir Omerović

Researcher



71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina





Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com







-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Samir Omerovic
In reply to this post by Marta García-Granero
Thank you very much Marta.

The SET ERRORS = NONE solves the problem.

I have also tried what Jan suggested, to use set mxwarns = 0. but nothing happened.

You saved me a lot of deleting procedures :)

Thanks once more

Samir


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Marta García-Granero
Sent: Friday, January 12, 2007 9:29 AM
To: [hidden email]
Subject: Re: Delete macro - macro name

Hi Samir

SO> The problem is actually in the output. As I said I have made
SO> macro using DEFINE command which I use
SO> to produce large quantity of tables using just few syntaxes.
SO> If I for some reason need to run the
SO> syntax again (and that happens often) I got the following text

>>Warning # 6804 in column 3.  Text: V4 -(THIS IS THE NAME OF THE MACRO I CREATED)
>>The macro name specified on the DEFINE command duplicates the name of a
>>previously defined macro.  This instance will take precedence.

SO> I understand why this happens and I understand that I can
SO> simply delete it and think of it no
SO> further but I was wondering if I can delete macro name
SO> through syntax so when I run it again I do
SO> not get this message, well... it would save me some time.

No, MACROs can't be erased from memory. to avoid the error message,
you can either:

1) "Wrap" your MACRO definition with this lines:

PRESERVE.
SET ERRORS=NONE.

DEFINE...

(you MACRO comes here)

!ENDDEFINE.

RESTORE.

2) Separate in two different files the MACRO definition from the MACRO
call. You run the MACRO definition only once, and, since the MACRO
will remain active until you close SPSS, you can close that file. Then
you run any times you want the file(s) with the MACRO calls.

I use both methods with my students: we have a file called
"MACROS.sps" with the macros they are going to use frequently during
class. Anyway, as they insist on INSERTing the file any time they are
going to call a MACRO (they forget they already activated them), I
have added "PRESERVE. SET ERRORS=NONE." and "RESTORE." to the
beginning and end of the MACROS definition file to avoid the error
message (you can argue it would be better to tell my students not to
run the MACROS definition file more than once, but after years of
telling them again and again, I surrendered and added the output flow
control lines to the file, just for my sanity sake).





--
Regards,
Dr. Marta García-Granero,PhD           mailto:[hidden email]
Statistician

---
"It is unwise to use a statistical procedure whose use one does
not understand. SPSS syntax guide cannot supply this knowledge, and it
is certainly no substitute for the basic understanding of statistics
and statistical thinking that is essential for the wise choice of
methods and the correct interpretation of their results".

(Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind)
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Richard Ristow
In reply to this post by Samir Omerovic
At 02:34 AM 1/12/2007, Samir_Omerovi wrote:

>I have made macro using DEFINE command. If I for some reason need to
>run the
>syntax again (and that happens often) I got the following text
>
> >Warning # 6804 in column 3.  Text: V4 -(THIS IS THE NAME OF THE
> MACRO I CREATED)
> >The macro name specified on the DEFINE command duplicates the name
> of a
> >previously defined macro.  This instance will take precedence.

If it'll make you feel better, you're not the first user to be annoyed
by this. Starting at SPSS 14, this is no longer a warning. SPSS draft
output {WRR-not kept separately}:


DEFINE !TestMsg ()
.  ECHO 'First definition of the macro'.
!ENDDEFINE.

!TestMsg

First definition of the macro
DEFINE !TestMsg ()
.  ECHO 'Second definition of the macro'.
!ENDDEFINE.

!TestMsg.
Second definition of the macro
Reply | Threaded
Open this post in threaded view
|

Re: Delete macro - macro name

Art Kendall-2
In reply to this post by Samir Omerovic
Highlight and run only the portions of the syntax that are not the macro
definition.

Art Kendall
Social Research Consultants

Samir Omerović wrote:

>Hi Gary,
>
>
>
>The problem is actually in the output. As I said I have made macro using DEFINE command which I use
>to produce large quantity of tables using just few syntaxes. If I for some reason need to run the
>syntax again (and that happens often) I got the following text
>
>
>
>
>
>>Warning # 6804 in column 3.  Text: V4 -(THIS IS THE NAME OF THE MACRO I CREATED)
>>
>>
>
>
>
>>The macro name specified on the DEFINE command duplicates the name of a
>>
>>
>
>
>
>>previously defined macro.  This instance will take precedence.
>>
>>
>
>
>
>I understand why this happens and I understand that I can simply delete it and think of it no
>further but I was wondering if I can delete macro name through syntax so when I run it again I do
>not get this message, well... it would save me some time.
>
>
>
>Samir
>
>
>
>
>
>
>
>  _____
>
>From: Hal 9000 [mailto:[hidden email]]
>Sent: Thursday, January 11, 2007 9:10 PM
>To: Samir Omerović; [hidden email]
>Subject: Re: Delete macro - macro name
>
>
>
>What is the problem that you are trying to fix?
>
>I wonder if what you mean to say is that you only want to run the macro under certain circumstances.
>-Gary
>
>
>
>On 1/11/07, Samir Omerović <[hidden email]> wrote:
>
>Hi to all again,
>
>
>
>I have question regarding Macros in SPSS. I have made macro using DEFINE command (explained to me
>through this email list, which I am in debt forever). I would like to delete the macro or its name
>using syntax. Is there a way to do it?
>
>
>
>Best regards to all
>
>
>
>Samir
>
>
>
>
>
>GfK BH
>
>Centar za istrazivanje trzista i javnog mnijenja d.o.o.
>
>
>
>Samir Omerović
>
>Researcher
>
>
>
>71 000  Sarajevo, Skenderija 44
>
>Bosna i Hercegovina
>
>
>
>
>
>Tel: +387 33 550 300
>
>Fax: +387 33 444 226
>
>www.gfk.ba
>
>www.gfk.com
>
>
>
>
>
>
>
>-----------------------------------------
>
>This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
>not the intended recipient (or have received this e-mail in error) please notify the sender
>immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
>material in this e-mail is strictly forbidden.
>
>Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
>molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
>objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.
>
>---------------------------------------
>
>
>
>