|
CONTENTS DELETED
The author has deleted this message.
|
|
Administrator
|
You need to indicate the nature of your difficulty. You do not appear to have attempted to incorporate your conditional situation into the macro. I solved your previous question to get you started. Make some attempt yourself and post whatever errors you might encounter.
Meanwhile, see !DO !DOEND. Note the control variable in your !DO !IN loop is called !D. That will be relevant. ---
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
|
CONTENTS DELETED
The author has deleted this message.
|
|
Administrator
|
That should tell you something rather subtle about how SPSS operates?
Consider the following abstraction: It raises error for the DO IF () .. But not for the !IF..() Basically the first RECODE is *PARSED* and analyzed/evaluated independently of any transformational conditional statement. Within a MACRO !IF-!IFEND block all code is simply *ignored* if the *STRING COMPARISON* fails. I emphasize *STRING COMPARISON* because if you do this long enough you will arrive at the startling revelation that !IF (12 !LT 2) ...will evaluate to *TRUE!!!*. Moral: Either live with the errors for the files which don't have the variable present or use the !IF-!IFEND version. **PLEASE USE** SET MPRINT ON PRINTBACK ON. when attempting to degub macros!!! --- DATA LIST FREE /X. BEGIN DATA 1 END DATA. DEFINE BLAH ( Xblah !TOKENS(1)). PRINT "1". DO IF (!XBlah EQ "1X"). RECODE SEX(1=2). END IF. PRINT "2". !IF (!XBlah !EQ "1X") !THEN. RECODE SEX=(1=2). !IFEND. !ENDDEFINE. SET MPRINT ON PRINTBACK ON. BLAH Xblah "XX".
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
|
CONTENTS DELETED
The author has deleted this message.
|
| Free forum by Nabble | Edit this page |
