Printing data from two series with same dates

For questions and discussion related to reading in and working with data.
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Printing data from two series with same dates

Unread post by msrahman »

Hello,

I have two daily series (series-1 and 2) for the same period with a bit different dates, as series-1 considers holidays but series -2 does not. I want to pick and print only those data points for series-2 which correspond to the dates in series-1. I proceeded in this way:

CAL(D) 1986 1 2
All 2014:12:29
open data C:\laptop\Oil-Stock\Soojin\Jo2013_Exp_Int_tvol_rvol\Data\series-1.xls
data(for=XLS,org=obs) / oil
set year = %year(t)
set month = %month(t)
set day = %day(t)


CAL(D) 1986 1 2
All 2014:12:29
open data C:\laptop\Oil-Stock\Soojin\Jo2013_Exp_Int_tvol_rvol\Data\series-2.xls
data(for=XLS,org=obs) / Int
print / year month day Int

I am not sure if this is right. I would appreciate if there is any further suggestion.

Thanks in advance.

Sincerely,
Sajjadur.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Printing data from two series with same dates

Unread post by TomDoan »

Offhand it sounds like you want

CAL(D) 1986 1 2
All 2014:12:29
open data C:\laptop\Oil-Stock\Soojin\Jo2013_Exp_Int_tvol_rvol\Data\series-1.xls
data(for=XLS,org=obs) / oil
set year = %year(t)
set month = %month(t)
set day = %day(t)
open data C:\laptop\Oil-Stock\Soojin\Jo2013_Exp_Int_tvol_rvol\Data\series-2.xls
data(for=XLS,org=obs) / Int
*
print(smpl=%valid(oil)) / year month day int

(You could also do a COPY instruction instead of PRINT if you want to create a new data file).
Post Reply