Auto read first and last date

For questions and discussion related to reading in and working with data.
BinhPham
Posts: 51
Joined: Tue Feb 14, 2017 10:00 am

Auto read first and last date

Unread post by BinhPham »

Dear Tom,

While Data wizard has a scan function to read the first and last data points, saying 1995:02 and 2017:04, how can do it programmatically using DATA instruction? I do not see the possibility with OPEN DATA and DATA commands.

The idea is that I have 6 excel files which contain data for six stocks. I don't want to set the starting date manually for each dataset, the last date is the same for all countries. Using data wizard RATS sees the different starting dates so that it generates the corresponding codes. Which instruction can read the first date? Or I have to program by reading the text then read the first row to extract the date?

Is there any shortcut?
Kind regards,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Auto read first and last date

Unread post by TomDoan »

If you have usable dates on the file, set a start date for the work space that's the earliest start date of the data sets (or earlier). When you read data, the entries prior to the start will come in as NA.
Post Reply