Page 1 of 1

Importing txt data - unstacking

Posted: Thu Jan 16, 2014 3:42 am
by tvonbrasch
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

Re: Importing txt data - unstacking

Posted: Thu Jan 16, 2014 9:20 am
by EViews Gareth
Could you provide an example file?

Re: Importing txt data - unstacking

Posted: Thu Jan 16, 2014 12:26 pm
by tvonbrasch
Sure,

here is the file with two countries only, and with a different industry for each country.
Thomas

Re: Importing txt data - unstacking

Posted: Thu Jan 16, 2014 12:53 pm
by EViews Gareth
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.

Re: Importing txt data - unstacking

Posted: Thu Jan 16, 2014 1:38 pm
by tvonbrasch
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

Re: Importing txt data - unstacking

Posted: Thu Jan 16, 2014 11:01 pm
by tvonbrasch
The update worked,

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