1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
* How to pass a conditionnal expression as a macro argument.
* Posted buy Raynald Levesque to spss newsgroup on 2002/04/22.


DATA LIST FREE /testvar.
BEGIN DATA
5 2 4 5
END DATA.
LIST.

SET MPRINT=no.
define !test(merkmal=!enclose('(',')'))
compute y=0.
if (!merkmal) y=1.
execute.
!enddefine.

SET MPRINT=yes.
!test merkmal=(testvar=5).