Variable naming importing from csv
Posted: Thu Feb 08, 2024 12:17 am
Hi
I am having some difficulties importing data from a csv file into an EViews workfile. The code works precisely the way it should in EViews 12 but in EViews 13 I am experiencing some issues. The programe file essentially import monthly data (from a csv file) starting in 2008 for 6 entities (same csv file is being used in both versions of EViews). There are 2 series per entity (let's call the series "income" and "expense") The programe file then rename the 6 entities to new names. Then after that EViews rename the imported series to "income" and "expense". In EViews 12 the work file then displays the new variable name with the corresponding entity (e.g. "_5111$income$abc" or "_5111$expense$abc"). This is then done for all 6 entities. In EViews 13 however, the variable name only shows "num1" to "num111" and not the name as indicated above ("_5111$income$abc" or "_5111$expense$abc"). I thought that it had to do with the "byrow" or "colhead" command, but it seems like the problem is elsewhere. Please see the extract of the code below. What is the solution for Eviews 13 and is there a possible solution that will work in both EViews 12 and EViews 13?
Your suggestions are highly appreciated.
Kind regards
Pieter
import(c=a, propnas) "C:\MyArea\2024 Model\database\Test300.csv" ftype=ascii rectype=crlf skip=2 fieldtype=delimited delim=comma byrow colhead=5 eoltype=pad badfield=NA @freq M 2008M1 @id @destid @date @smpl @all
rename *first_ent abc*
rename *second_ent def*
rename *third_ent ghi*
rename *fouth_ent jkl*
rename *fifth_ent mno*
rename *Sixth_ent pqr*
rename *_1_190_Test300_ _5111$income$*
rename *_1_98_Test300_ _5111$expense$*
delete *Test300*
I am having some difficulties importing data from a csv file into an EViews workfile. The code works precisely the way it should in EViews 12 but in EViews 13 I am experiencing some issues. The programe file essentially import monthly data (from a csv file) starting in 2008 for 6 entities (same csv file is being used in both versions of EViews). There are 2 series per entity (let's call the series "income" and "expense") The programe file then rename the 6 entities to new names. Then after that EViews rename the imported series to "income" and "expense". In EViews 12 the work file then displays the new variable name with the corresponding entity (e.g. "_5111$income$abc" or "_5111$expense$abc"). This is then done for all 6 entities. In EViews 13 however, the variable name only shows "num1" to "num111" and not the name as indicated above ("_5111$income$abc" or "_5111$expense$abc"). I thought that it had to do with the "byrow" or "colhead" command, but it seems like the problem is elsewhere. Please see the extract of the code below. What is the solution for Eviews 13 and is there a possible solution that will work in both EViews 12 and EViews 13?
Your suggestions are highly appreciated.
Kind regards
Pieter
import(c=a, propnas) "C:\MyArea\2024 Model\database\Test300.csv" ftype=ascii rectype=crlf skip=2 fieldtype=delimited delim=comma byrow colhead=5 eoltype=pad badfield=NA @freq M 2008M1 @id @destid @date @smpl @all
rename *first_ent abc*
rename *second_ent def*
rename *third_ent ghi*
rename *fouth_ent jkl*
rename *fifth_ent mno*
rename *Sixth_ent pqr*
rename *_1_190_Test300_ _5111$income$*
rename *_1_98_Test300_ _5111$expense$*
delete *Test300*