Hello list,
as this is my first post on this mail-server allow me to introduce
myself: my name is Christoph and I have a problem with SPSS syntax/macro :)
I started programming syntax/macro yesterday. I bought the book "data
management with spss" from Schendera, but it doesn't help at a certain
point in my code.
I want to write a macro, that generates several variables. I managed
that the code generate the variables:
k1i1, k1i2 ... k1i5 (item battery 1)
k2i1, k2i2 ... k2i5 (item battery 2)
.
.
.
k6i1, k6i2 ... k6i5 (item battery 6)
Adding value labels by code worked fine.
And here ist the problem: I want to add a VARIABLE LABEL that ist
similiar to each k*i1, k*i2 etc.
I tried that code:
DEFINE !var1 (itemcnt = !TOKENS(1)/ concept = !TOKENS(1)/ item1 =
!TOKENS(1)/ item2 = !TOKENS(1)/ item3 = !TOKENS(1)/ item4 = !TOKENS(1)/
item5 = !TOKENS(1)).
!DO !k = 1 !TO !concept.
!DO !i = 1 !TO !itemcnt.
COMPUTE !CONCAT (k, !k, i, !i) = 1.
VARIABLE LABEL !CONCAT (k, !k, i, !i) !CONCAT (!item, !i).
!DOEND.
!DOEND.
!ENDDEFINE.
!var1
itemcnt = 5
concept = 6
item1 = "Satisfaction"
item2 = "Fit"
item3 = "..."
item4 = "..."
item5 = "..."
exe.
I tried several combinations (also tried without !CONCAT, used brackets
etc.) and i almost get out STRING variable labels, but i never calls up
a TOKEN. What can I do?
Thank you in advance.
Christoph
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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