Page 1 of 1

Printing data from two series with same dates

Posted: Tue Jan 06, 2015 4:25 pm
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.

Re: Printing data from two series with same dates

Posted: Wed Jan 07, 2015 10:14 am
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).