Timestamping databases

For questions regarding programming in the EViews programming language.

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

jramm
Posts: 8
Joined: Wed May 22, 2019 2:43 pm

Timestamping databases

Postby jramm » Mon May 27, 2019 3:15 pm

Hi,

Another day, another eviews questions....

This time would like to save a timestamped back up of a database. I've found some advise on the forum and are working with the following piece of code:

%date=@strnow("yyyy-mm-dd")
dbcopy database\data database\timestamps\db_{%date}

This code is suppose to save a copy of the database named "data" with a new name "db_today's date" (where "today's date" is in the yyyy-mm-dd formate and change with the calendar) in the subfolder timestamps.

However, I get the error message "%DATE is not a valid string or scalar name", can anyone help me?

As always, many thanks in advance.

Cheers,
Joachim

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

Re: Timestamping databases

Postby EViews Gareth » Mon May 27, 2019 3:24 pm

Silly question, but did you do it in a program?
Follow us on Twitter @IHSEViews

jramm
Posts: 8
Joined: Wed May 22, 2019 2:43 pm

Re: Timestamping databases

Postby jramm » Mon May 27, 2019 3:31 pm

Not a silly question at all.

The database will be updated on a regular basis (one or twice per week) and we need the ability to go "back in time" to access how the database looked at various points in the past. We also work with "data cut-offs" so having date stamped databases makes it easier to ensure that everybody is using the same database.

Hope this clarifies my questions. If there are better ways to do this I definitively open.

Thanks,
Joachim

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

Re: Timestamping databases

Postby EViews Gareth » Mon May 27, 2019 3:33 pm

No, I meant when you ran the line:

Code: Select all

dbcopy database\data database\timestamps\db_{%date}

was it inside an EViews program, or was it from the EViews command line?
Follow us on Twitter @IHSEViews

jramm
Posts: 8
Joined: Wed May 22, 2019 2:43 pm

Re: Timestamping databases

Postby jramm » Mon May 27, 2019 4:20 pm

I ran that line in the command file

jramm
Posts: 8
Joined: Wed May 22, 2019 2:43 pm

Re: Timestamping databases

Postby jramm » Mon May 27, 2019 4:27 pm

Wow, when I ran it in the program it worked!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 22 guests