I am trying to systemize data based on lists in Datastream. One list encompasses all stocks in Oslo Stock Exchange. More specialized lists for different liquidity categories and different industry sectors are subsets of the list of all stocks. Financial data using these lists is downloaded to Excel for various variables, for instance bid price(PB), earnings per share(EPS), earnings before interest, tax, depreciation and amortization(EBITDA) and so on.
I found the following handy code in your pages to transfer from Excel to Eviews:
Code: Select all
%filename = "c:\temp\sheetpanel.xlsx" 'file name of the file to be opened
%sheetnames = @tablenames(%filename) 'find the names of the sheets in that file
%sheetname = @word(%sheetnames,1) 'get the first sheet name
wfopen(wf=panel,page=%sheetname) %filename range=%sheetname 'open the first sheet as a new workfile (with name=panel, and pagename=the first sheet name)
'loop through the remaining sheets, loading them into the workfile one at a time
for !i=2 to @wcount(%sheetnames)
%sheetname = @word(%sheetnames,!i) 'get the name of the next sheet
pageload(page=%sheetname) %filename range=%sheetname 'load the next sheet
nextI give an example of a group in EViews, created "manually", based on data downloaded using a list in Datastream for bid price (PB), which consists of the most liquid stocks:
n_akso_pb_
n_alge_pb_
n_deto_pb_
n_dnb_pb_
n_dno_pb_
n_foe_pb_
n_fro_pb_
n_gjf_pb_
n_gol_pb_
n_mhg_pb_
n_nhy_pb_
n_ork_pb_
n_pgs_pb_
n_prs_pb_
n_rcl_pb_
n_rec_pb_
n_sch_pb_
n_sdrl_pb_
n_song_pb_
n_stb_pb_
n_stl_pb_
n_subc_pb_
n_tel_pb_
n_tgs_pb_
n_yara_pb_
Can I use a code to make groups for the same stocks (the stock names are in the middle) but for other financial variables, for instance for EPS-data? Much obliged for any ansewrs and suggestions.
