SPSS macro does not process list correct

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

SPSS macro does not process list correct

Thomas Lindner
Dear SPSS-users,

I try to create some new filter variables using a macro (using SPSS 15.0.1 on WindowsXP pro).

               DEFINE !probe1 (zet=!ENCLOSE('(',')' ))
                !Do !i !IN (!zet)
                compute !concat(filter, !zet) = 0 .
                !DOEND
                EXECUTE .
        !ENDDEFINE .

        !probe1 zet=  (b c) .

As long as I use the macro with only one element within the list it works fine. But if I use more than one elements I get an error message (see output of the log at the end).

The elements (b and c) of the list (zet) may not recognised as single elements. They are used as "b c".
(output row 173, 174)

I appreciate any advise helping to solve this problem.

Thank you in advance.

Thomas Lindner



output from log:


 164 M>  DEFINE
 165 M>   !Probe1 (zet=!ENCLOSE('(',')' ))
 166 M>   !Do !i !IN (!zet)
 167 M>   compute !concat(filter, !zet) = 0 .
 168 M>   !DOEND
 169 M>   EXECUTE .
 170 M>   !ENDDEFINE .

!Probe1 zet=  (b c) .
 171 M>
 172 M>  .
 173 M>  compute filterb c = 0.

>Error # 4382 in column 17.  Text: c
>An equals sign was not found when expected after a target variable in a
>COMPUTE command.
>This command not executed.

 174 M>  compute filterb c = 0.

>Error # 4382 in column 17.  Text: c
>An equals sign was not found when expected after a target variable in a
>COMPUTE command.
>This command not executed.

 175 M>  EXECUTE
 176 M>  .

--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: SPSS macro does not process list correct

Melissa Ives
For George....

By the way, I tried again and got the same "You are spam" message. Double unhappy here. My test goes fine but my answer doesn't.
Here is my message:

"Trying again!

Hi Thomas,
Use
compute !concat(filter, !I) = 0 .

instead of
compute !concat(filter, !zet) = 0 .

Regards,
George"

Regards,
George


Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Thomas Lindner
Sent: Thursday, October 16, 2008 5:08 AM
To: [hidden email]
Subject: [SPSSX-L] SPSS macro does not process list correct

Dear SPSS-users,

I try to create some new filter variables using a macro (using SPSS 15.0.1 on WindowsXP pro).

               DEFINE !probe1 (zet=!ENCLOSE('(',')' ))
                !Do !i !IN (!zet)
                compute !concat(filter, !zet) = 0 .
                !DOEND
                EXECUTE .
        !ENDDEFINE .

        !probe1 zet=  (b c) .

As long as I use the macro with only one element within the list it works fine. But if I use more than one elements I get an error message (see output of the log at the end).

The elements (b and c) of the list (zet) may not recognised as single elements. They are used as "b c".
(output row 173, 174)

I appreciate any advise helping to solve this problem.

Thank you in advance.

Thomas Lindner



output from log:


 164 M>  DEFINE
 165 M>   !Probe1 (zet=!ENCLOSE('(',')' ))
 166 M>   !Do !i !IN (!zet)
 167 M>   compute !concat(filter, !zet) = 0 .
 168 M>   !DOEND
 169 M>   EXECUTE .
 170 M>   !ENDDEFINE .

!Probe1 zet=  (b c) .
 171 M>
 172 M>  .
 173 M>  compute filterb c = 0.

>Error # 4382 in column 17.  Text: c
>An equals sign was not found when expected after a target variable in a
>COMPUTE command.
>This command not executed.

 174 M>  compute filterb c = 0.

>Error # 4382 in column 17.  Text: c
>An equals sign was not found when expected after a target variable in a
>COMPUTE command.
>This command not executed.

 175 M>  EXECUTE
 176 M>  .

--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (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

PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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