copy unstructured to structured dated page, with missing values

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

copy unstructured to structured dated page, with missing values

Postby BT454 » 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*
Attachments
nukeqry.wf1
(28.38 MiB) Downloaded 143 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13319
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Tue Jan 05, 2021 7:57 am

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?
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

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

Postby BT454 » Tue Jan 05, 2021 8:09 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13319
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Tue Jan 05, 2021 8:12 am

Code: Select all

pageselect nameofdailypage
series date = @date
copy nameofunstructuredpage\nameofseries nameofdailypage\nameofseries @src date @dest date
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

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

Postby BT454 » Tue Jan 05, 2021 8:15 am

Perfect! Thank you so much!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 38 guests