Importing txt data - unstacking

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

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

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Importing txt data - unstacking

Postby tvonbrasch » Thu Jan 16, 2014 3:42 am

Hi,

Im trying to import the OECD STAN database, where the txt file starts as:

Cou|Var|ind|year|value|datanote
AUS|CPNK|0199|1970|680794818590|
AUS|CPNK|0199|1971|718765520049|
...
USA|WAGE|zzz5|2008|368303000000|p
USA|WAGE|zzz5|2009|332853000000|p

when importing this file i tried the command
wfopen(type=text) "..\data\stan_all\data.txt" custom="|" names=(country, variable, industry, time, data) types=(a,a, a, d, f).

However, the industry variable is read as a number (199) and not an industry code. the industry code zzz5 is recorded as na.

Question 1: what is the command for importing this type of text file?
Question 2: what is the code to untsack this file into a pooled workfile? will pageunstack variable country industry time work?

Hope you can help me with this
Sincerely
Thomas

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

Re: Importing txt data - unstacking

Postby EViews Gareth » Thu Jan 16, 2014 9:20 am

Could you provide an example file?

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: Importing txt data - unstacking

Postby tvonbrasch » Thu Jan 16, 2014 12:26 pm

Sure,

here is the file with two countries only, and with a different industry for each country.
Thomas
Attachments
Data_2_countries.txt
(68.39 KiB) Downloaded 321 times

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

Re: Importing txt data - unstacking

Postby EViews Gareth » Thu Jan 16, 2014 12:53 pm

Industry read as an alpha for me (up to date EViews 8), using your exact code (with a file name change).

It looks like you have a 3D panel. You can't unstack it into a Pool, unless you're willing to contract two of the dimensions into one.

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: Importing txt data - unstacking

Postby tvonbrasch » Thu Jan 16, 2014 1:38 pm

Hi,

thats strange. Now im at home, using Eviews 7.2, and it will not read the industry information as an alpha. but Eviews 7.2 does not recognise the command types=(a,a, a, d,f), so my command now reads

wfopen(type=text) "..\data\stan_all\data_2_countries.txt" custom="|" names=(country, variable, industry, time, data)

At work i have Eviews 8. I will double check that im running the latest version tomorrow. I hope updating the software works.

Thanks for looking at this
Thomas
Attachments
data_2_countries.WF1
(88.25 KiB) Downloaded 240 times

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: Importing txt data - unstacking

Postby tvonbrasch » Thu Jan 16, 2014 11:01 pm

The update worked,

I had the november version. updating it to dec 19 2013 worked.
Thanks
Thomas


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests