I would like to get a SVECTOR or a STRING of all dates in sample

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

leocaza
Posts: 18
Joined: Mon Nov 27, 2017 7:18 am

I would like to get a SVECTOR or a STRING of all dates in sample

Postby leocaza » Wed Dec 05, 2018 2:13 pm

I would like to get a SVECTOR or a STRING of all dates in sample

For now I am doing this :

scalar tee = @rows(time)
freeze(time) usdcad
svector(@rows(time)) sampledate
for !i=10 to @rows(time)
sampledate(!i-9) = time(!i,1)
next
String sampledates = @wjoin(sampledate)

It is an "hack" to get the result done... but the code isn't clean enough for me.

Do you have a simpler way to do this ?

Thank you,
LC

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: I would like to get a SVECTOR or a STRING of all dates in sample

Postby EViews Gareth » Wed Dec 05, 2018 2:35 pm

Code: Select all

alpha mydate = @datestr(@date, "YYYY/MM/DD")
svector mydatesv = @convert(mydate)


Not sure what your code is doing, so I can't confirm this does the same thing, but it does what you said you wanted to do (create an svector with all dates in current sample).
Follow us on Twitter @IHSEViews

leocaza
Posts: 18
Joined: Mon Nov 27, 2017 7:18 am

Re: I would like to get a SVECTOR or a STRING of all dates in sample

Postby leocaza » Thu Dec 06, 2018 7:26 am

Thank you for that

Last question : Is there a way to convert a "Table" column into an alpha series or a SVECTOR or a string list ?

Thank you
LC

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: I would like to get a SVECTOR or a STRING of all dates in sample

Postby EViews Gareth » Thu Dec 06, 2018 8:23 am

Not easily.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 32 guests