Page 1 of 1

copy unstructured to structured dated page, with missing values

Posted: Tue Jan 05, 2021 7:38 am
by BT454
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*

Re: copy unstructured to structured dated page, with missing values

Posted: Tue Jan 05, 2021 7:57 am
by EViews Gareth
Can't tell from your code or your file exactly what you're trying to do, but it sounds like you're bringing data into an unstructured page. You could just copy it to a regular frequency page, using dates to do the match merge?

Re: copy unstructured to structured dated page, with missing values

Posted: Tue Jan 05, 2021 8:09 am
by BT454
Hi, and thanks for the quick reply.
That is exactly what I'm trying to do. How do I use the dates series to do the match merge?
Thanks!
Bob

Re: copy unstructured to structured dated page, with missing values

Posted: Tue Jan 05, 2021 8:12 am
by EViews Gareth

Code: Select all

pageselect nameofdailypage series date = @date copy nameofunstructuredpage\nameofseries nameofdailypage\nameofseries @src date @dest date

Re: copy unstructured to structured dated page, with missing values

Posted: Tue Jan 05, 2021 8:15 am
by BT454
Perfect! Thank you so much!