Home > Enterprise >  SPSS LOOP with VECTOR(index) gives spss-error 4023
SPSS LOOP with VECTOR(index) gives spss-error 4023

Time:10-26

I have the following LOOP syntax:

 VECTOR tb= tb1 TO tb16 / X(16).
 EXECUTE.
 loop #i = 1 to 5.
 if (tb(#i) > 0) X(#i) = tb(#i).
 end loop.
 exe.

And SPSS tells me:

 >Error # 4023 in column 5.  Text: tb 
 >An expression contains a string of characters followed by a left parenthesis, 
 >indicating that the string of characters is a function or vector name, but the 
 >characters do not match any existing function or vector.  Check the spelling. 
 >Execution of this command stops.

Help please.

CodePudding user response:

Remove EXECUTE. after vector definition. That deletes the tb vector from memory. tb is stored in memory until the first EXECUTE.

  • Related