How do I update a panel workfile with more recent data( with the same variables and cross-sections)? I thought this would be simple but can't get it working.
Details:
I download a database into an excel file. However, updating the whole database takes very long, hence I made two sets of the same spreadsheet:
-Data_Historical (all panel observations before January 2014), and
-Data_current (all panel observations from January 2014).
Both spreadsheets are the same except for the observations covering a different time period. Initially I tried the default import:
Code: Select all
wfopen(page=data) "data_historical" range=tab1
pagestruct @date(reporting_period) crossid
%filename= "Data_current"
import(page=data) %filename range=tab1 colhead=1 na="#N/A" @id crossid @date(reporting_period) @smpl @all
I was impressed that this deleted all of the data prior to 2014, leaving only the current data. Then I tried a 'mode' option to prevent overwriting missing observations:
Code: Select all
'after importing historical data:
%filename= "Data_current"
import(mode=ms,page=data) %filename range=tab1 colhead=1 na="#N/A" @id crossid @date(reporting_period) @smpl @all
This did not overwrite the old data, but it did not add the new observations either. So I tried adding the resize options to allow the sample to change:
Code: Select all
'after importing historical data:
%filename= "Data_current"
import(resize, mode=ms, page=data) %filename range=tab1 colhead=1 na="#N/A" @id crossid @date(reporting_period) @smpl @all
This still does not seem to bring in the new observations (it appears to have no effect at all). Next, I tried unstructuring the data to start with:
Code: Select all
%filename = "data_historical"
wfopen(page=data) %filename range=Tab1
%filename = "data_current"
import(mode=ms) %filename range=Tab1
The data up to 2013 is imported, but the second appears not to do anything. What am I doing wrong?
Thank you for your time,
Diego