exporting time series with time stamp

For questions and discussion related to reading in and working with data.
Gilbril
Posts: 78
Joined: Thu Aug 19, 2010 2:00 pm

exporting time series with time stamp

Unread post by Gilbril »

Dear Tom, I want to export forecasted series to an rat file. However I want to add a time stamp to the forecasted series to see how the forecast has changed when new data has arrived. So I want to append the series forecast05.01.19 than forecast06.01.19 and so on to the same file. The labeling of the series with todays date should work automatically. How do I do that? Function %today() does not attach todays name.
Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: exporting time series with time stamp

Unread post by TomDoan »

%dateandtime() will return the current date and time, and you can hack the information out of that. (I believe the date is coded in what's the most common coding for a date in your country)---for the U.S. it comes in as mm/dd/yyyy.

compute today=%dateandtime()
disp %mid(today,1,2)+"_"+%mid(today,4,2)+"_"+%mid(today,9,2)

gives

06_07_19

You can't use .'s in a name---use _ as punctuation if you want it.
Post Reply