How do I refer to a specific date in a series within a loop?
Posted: Tue Sep 22, 2015 2:55 pm
This code
throws an error:
Is it possible to refer to a specific date within a series when the code is referring to that series in a loop index? I looked in the index to the User's Guide for terms related to "indexing" and "series" but didn't have any luck. I know I could do something like this:
but that seems like overkill.
Code: Select all
calendar(q) 1947 1
set a 2010:1 2010:4 = 2
set b 2010:1 2010:4 = 3
compute dt = 2010:2
dofor s = a b
display s(dt)
end dofor s
Code: Select all
calendar(q) 1947 1
set a 2010:1 2010:4 = 2
set b 2010:1 2010:4 = 3
compute dt = 2010:2
dofor s = a b
(01.0062) display s(<<<<
## SX17. Missing Operator or Adjacent Operands
>>>>dt)end dofor s
Code: Select all
calendar(q) 1947 1
set a 2010:1 2010:4 = 2
set b 2010:1 2010:4 = 3
compute dt = 2010:2
dofor s = a b
statistics s dt dt
display %mean
end dofor s