DOFOR Loop Question
Posted: Mon Jan 27, 2014 9:00 pm
If I write this code:
COMPUTE X = PORT941NA(2007:12)
DISPLAY X
I get what I expect:
1041.50000
If I place it inside a DOFOR loop:
DOFOR JJ = PORT941NA PITT342NA MINN427NA CHIC917NA AUST448NA PHOE004NA DENV708NA NASH947NA OKLA440NA
COMPUTE X = JJ(2007:12)
DISPLAY X
END DOFOR JJ
I get this:
## SX17. Missing Operator or Adjacent Operands
>>>> COMPUTE X = JJ(<<<<
So I can I identify just one entry in the DOFOR loop?
Thank you!
COMPUTE X = PORT941NA(2007:12)
DISPLAY X
I get what I expect:
1041.50000
If I place it inside a DOFOR loop:
DOFOR JJ = PORT941NA PITT342NA MINN427NA CHIC917NA AUST448NA PHOE004NA DENV708NA NASH947NA OKLA440NA
COMPUTE X = JJ(2007:12)
DISPLAY X
END DOFOR JJ
I get this:
## SX17. Missing Operator or Adjacent Operands
>>>> COMPUTE X = JJ(<<<<
So I can I identify just one entry in the DOFOR loop?
Thank you!