At 03:43 PM 2/9/2007, Marks, Jim wrote:
>A statement like:
>COMPUTE P01_VAR3 = $SYMSIS.
>IF P01_VAR4 > 0 P01_VAR3 = P01_VAR1.
>Will reset all the values and populate P01_VAR3 with the values you
Touché. That's the way we did it before DO IF was
introduced. It's shorter, easier to write, and
easier to get right, than the DO IF solution I gave:
>>DO IF ( P01_VAR4 > 0 )
>> AND NOT MISSING( P01_VAR4 > 0 ).
>>. COMPUTE P01_VAR3 = P01_VAR1 .
>>. COMPUTE P01_VAR3 = $SYSMIS.
There's a lot to be said for remembering old-school styles.
Jim also wrote,
>It looks like you have a set of variables to process. If so, something
>using DO REPEAT could reduce your typing:
Yes. Reduce your typing, make your code shorter
and more readable, and be less prone to errors.
-Good luck, and thanks,