Page 1 of 1

How can I copy data from series into a vector?

Posted: Fri Jul 12, 2013 10:54 am
by UserCATS
Hi everyone,

I use the following instructions to copy data from my 249 series into a vector: (my series are in a excel sheet label as A1, A2, A3, A4 .... A249)

DECLARE VECTOR[SERIES] A(249)

set A(1) = A1

When I enter this instructions RATS does not create nothing.

How can I do?

And also How can I loop to put all the series in "A" vector and not one by one?


Thanks in advance

Re: How can I copy data from series into a vector?

Posted: Fri Jul 12, 2013 11:05 am
by TomDoan
UserCATS wrote:Hi everyone,

I use the following instructions to copy data from my 249 series into a vector: (my series are in a excel sheet label as A1, A2, A3, A4 .... A249)

DECLARE VECTOR[SERIES] A(249)

set A(1) = A1

When I enter this instructions RATS does not create nothing.

How can I do?

And also How can I loop to put all the series in "A" vector and not one by one?


Thanks in advance
A SET instruction doesn't show any output. If you do

STATS A(1)

you should be able to see that it worked.

To take care of all of them, use the %S function to get at the Ann series:

DECLARE VECTOR[SERIES] A(249)
do i=1,249
set a(i) = %s("a"+i)
end do i