How can I copy data from series into a vector?

For questions and discussion related to reading in and working with data.
UserCATS
Posts: 2
Joined: Tue Nov 06, 2012 4:16 am

How can I copy data from series into a vector?

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

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

Unread post 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
Post Reply