Page 1 of 1

Timestamping databases

Posted: Mon May 27, 2019 3:15 pm
by jramm
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

Re: Timestamping databases

Posted: Mon May 27, 2019 3:24 pm
by EViews Gareth
Silly question, but did you do it in a program?

Re: Timestamping databases

Posted: Mon May 27, 2019 3:31 pm
by jramm
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

Re: Timestamping databases

Posted: Mon May 27, 2019 3:33 pm
by EViews Gareth
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?

Re: Timestamping databases

Posted: Mon May 27, 2019 4:20 pm
by jramm
I ran that line in the command file

Re: Timestamping databases

Posted: Mon May 27, 2019 4:27 pm
by jramm
Wow, when I ran it in the program it worked!