Linkage between two types of codes, or "Join"

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

fnarita
Posts: 15
Joined: Thu Jun 04, 2009 11:15 am

Linkage between two types of codes, or "Join"

Postby fnarita » Fri Jun 05, 2009 10:51 am

Hi,

I'd like to connect numeric codes in one page with string codes in another page.
The procedure in my mind is what is called "JOIN" in a database language, such as SQL.

Specifically, I have one page that has two series of codes: one alpha series of 3 letter country codes, such as USA or JPN, and one numeric series of 3 digit country codes, such as 111, which is for USA. So, this page works as a reference between two types of codes. Name this page "Country_List".

On the other hand, I have one page of stacked panel data, which contain 3 digit country codes and variables of interest. Name this page "Stacked_Data".

What I want to do is to add one alpha series of 3 letter country codes in "Stacked_Data" page, and to let them correspond to the series of 3 digit codes that already exists in "Stacked_Data" page, using the information in "Country_List" page.

Can we do it by EViews 6?
(By the way, today I've just updated the EViews in my computer to version 6 from version 5.1. Colors in the program editor is very nice. :) )
I think it may be related with "Link" object, but I'm not sure how to do.

I will really appreciate it if anyone could give me any suggestion, reference, hint, or so.
I prefer to do it using "command", but a suggestion of using a dialog box will also be appreciated.

I attached my workfile up to the point I'm in trouble. (The filename is iip.wf1.)
The 3 letter code is "ccode" in "Country_List" page, and the corresponding 3 digit code is "ifs_code" in both "Country_List" and "Stacked_Data" page.

"ipnfa" in "Stacked_Data" page is the variable of interest. Eventually, I'd like to make unstacked series of "ipfna" for each country, such as USA_ipfna, JPN_ipfna, and so on.

Thank you very much for your time and consideration,
Futoshi
Attachments
iip.wf1
(898.37 KiB) Downloaded 291 times

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

Re: Linkage between two types of codes, or "Join"

Postby EViews Gareth » Fri Jun 05, 2009 11:09 am

Code: Select all

copy country_list\ccode stacked_data\ccode @src ifs_code @dest ifs_code
Follow us on Twitter @IHSEViews

fnarita
Posts: 15
Joined: Thu Jun 04, 2009 11:15 am

Re: Linkage between two types of codes, or "Join"

Postby fnarita » Fri Jun 05, 2009 11:38 am

Thank you so much, QMS Gareth.
Your code works perfectly.
I really appreciate your help! :D

Many thanks,
Futoshi


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 14 guests