|
Line 3:
"!COMPUTE "
Nix the ! .
anitha.un wrote
>
> Hi All,
>
> I have a requirement where i need to create variables with the pattern
> like Var1Sub1, Var1Sub2,Var1Sub4 , Var1Sub8, Var2Sub1, Var2Sub2, Var2Sub4
> , Var2Sub8, Var3Sub1,Var3Sub2, Var3Sub4,Var3Sub8, Var3Sub9.
>
> Below is the code i wrote :
>
> DEFINE !myvar (nb_loop= !TOKENS(5)).
> !DO !cnt=1 !TO !nb_loop
> !COMPUTE !CONCAT(variable,!cnt)=!cnt.
> COMPUTE !CONCAT(sub,1)=!sub1.
> COMPUTE !CONCAT(!cnt,!sub1)=!var1.
> COMPUTE !CONCAT(sub,2)=!sub2.
> COMPUTE !CONCAT(!cnt,!sub2)=!var2.
> COMPUTE !CONCAT(sub,4)=!sub4.
> COMPUTE !CONCAT(!cnt,!sub4)=!var4.
> COMPUTE !CONCAT(sub,8)=!sub8.
> COMPUTE !CONCAT(!cnt,!sub8)=!var8.
> COMPUTE !CONCAT(sub,9)=!sub9.
> COMPUTE !CONCAT(!cnt,!sub9)=!var9.
> !DOEND
> EXECUTE.
> !ENDDEFINE.
>
> SET MPRINT ON.
> !myvar nb_loop=var1 var2 var4 var8 var9.
>
> I am getting an error : The first word in the line is not recognized as an
> SPSS Statistics command.
> Also i tried removing " . " in the define part, but it did not work.
>
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Error-The-first-word-in-the-line-is-not-recognized-as-an-SPSS-Statistics-command-tp5036280p5036453.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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
|