Import data with start and end date in columns

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

reep
Posts: 14
Joined: Fri Jan 27, 2012 2:24 am

Import data with start and end date in columns

Postby reep » Wed May 03, 2017 2:40 am

Hello,

I have text file in the following format:
isin startdate enddate volume art
xyz 2002q1 2006q3 100 10
zas 2001q1 2016q3 200 50
...

I would like to have import this file and create time series for every isin from the start to enddate. The variables volume and art should be the same for every single observation. How can I accomplish this?

Thanks.

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

Re: Import data with start and end date in columns

Postby EViews Gareth » Wed May 03, 2017 8:38 am

Do you wish them to be on the same page (meaning that there are lots of NAs given the differing start dates and end dates) or different pages?

Are they all the same frequency?
Follow us on Twitter @IHSEViews

reep
Posts: 14
Joined: Fri Jan 27, 2012 2:24 am

Re: Import data with start and end date in columns

Postby reep » Wed May 03, 2017 11:36 pm

Yes, I would like to have them on the same page.
Yes, the frequency is always quartely; data range is from 2003 to 2016.

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

Re: Import data with start and end date in columns

Postby EViews Gareth » Thu May 04, 2017 8:10 am

Code: Select all

wfcreate q 2003 2016

%list = @wread("c:\temp\test.txt")

for %ser {%list}
   %sname = @word(%ser,1)
   %start = @word(%ser,2)
   %end = @word(%ser,3)
   %vol = @word(%ser,4)
   %art = @word(%ser,5)
   
   smpl {%start} {%end}
   series {%sname}_vol = @val(%vol)
   series {%sname}_art = @val(%art)
   smpl @all
   
next
Follow us on Twitter @IHSEViews

reep
Posts: 14
Joined: Fri Jan 27, 2012 2:24 am

Re: Import data with start and end date in columns

Postby reep » Fri May 05, 2017 1:24 am

Thanks a lot!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 11 guests