copy unstructured to structured dated page, with missing values
Posted: Tue Jan 05, 2021 7:38 am
Hi all,
Happy new year!
I'm working on a job that queries a sql server for data, uses the unstack command to create time series, then creates dated data (to eventually create weekly data).
The dataset I'm querying unfortunately has missing values across the entire set (where no records are returned with the corresponding date, not even a date). When copying from the unstructured page to the structured, dated page, eviews does not recognize these missing values/dates (understandably so, as there are not NA's or even dates to indicate that the data has missing obesrvation).
Is there anyway eviews can scan the date series that is created with the sql pull to know when the a date is being skipped and create an NA in the series, insert the missing date(s), and populate the series with NAs? The code and work file are below.
As always, thank you again for your kind help and expertise.
Bob
close @wf
%startrange="1/1/2011"
%endrange=@datestr(@dateadd(@dateval(@date),1,"m"),"mm/dd/yyyy")
wfcreate(wf=nukeqry) d7 %startrange %endrange
pagecreate(page=sql_qry) u 1
shell(out=nukeqry) type "c:\warem32\sqlnukeqry.txt"
%nukeqry = nukeqry(1,1)
wfclose
'import HDD data
wfopen(type=odbc, timeout=60, link, wf=nukeqry) "c:\temp\PL_Server" %nukeqry' d7 %startrange %endrange
series date = @dateval(nukedate,"yyyy-mm-dd")
pageunstack(namepat=*?) seriesid date @ *
pagecreate(page=daily) d7 %startrange %endrange
copy untitled1\*nuke* daily\*nuke*
Happy new year!
I'm working on a job that queries a sql server for data, uses the unstack command to create time series, then creates dated data (to eventually create weekly data).
The dataset I'm querying unfortunately has missing values across the entire set (where no records are returned with the corresponding date, not even a date). When copying from the unstructured page to the structured, dated page, eviews does not recognize these missing values/dates (understandably so, as there are not NA's or even dates to indicate that the data has missing obesrvation).
Is there anyway eviews can scan the date series that is created with the sql pull to know when the a date is being skipped and create an NA in the series, insert the missing date(s), and populate the series with NAs? The code and work file are below.
As always, thank you again for your kind help and expertise.
Bob
close @wf
%startrange="1/1/2011"
%endrange=@datestr(@dateadd(@dateval(@date),1,"m"),"mm/dd/yyyy")
wfcreate(wf=nukeqry) d7 %startrange %endrange
pagecreate(page=sql_qry) u 1
shell(out=nukeqry) type "c:\warem32\sqlnukeqry.txt"
%nukeqry = nukeqry(1,1)
wfclose
'import HDD data
wfopen(type=odbc, timeout=60, link, wf=nukeqry) "c:\temp\PL_Server" %nukeqry' d7 %startrange %endrange
series date = @dateval(nukedate,"yyyy-mm-dd")
pageunstack(namepat=*?) seriesid date @ *
pagecreate(page=daily) d7 %startrange %endrange
copy untitled1\*nuke* daily\*nuke*