Freezing and Exporting Workfile Page

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

SamChampanhet
Posts: 15
Joined: Thu Feb 05, 2015 8:56 am

Freezing and Exporting Workfile Page

Postby SamChampanhet » Thu Feb 22, 2018 7:00 am

Hi,
How do I program a loop that will freeze each and every page of a workfile (detailed view with the object names and all the attributes) into a table and then save that table as ".csv"?

So far what I have is

Code: Select all

for %isic 90_93
   %wfname = "HFREQ_"+%isic+"_"+%vintage
   wfcreate(wf=%wfname, page=a) a 1980 %lyf
   wfdetails  Name Type "Last Update" Freq Start End Remarks
   pagecreate(page=q) q 1980 {%lyf}
   wfdetails  Name Type "Last Update" Freq Start End Remarks
   pagecreate(page=m) m 1980 {%lyf}
   wfdetails  Name Type "Last Update" Freq Start End Remarks
   %bank=%path+"wis_hfreq4.bnk"   
   dbopen %bank
      for %freq a q m
      pageselect {%freq}
      fetch *{%isic}*.{%freq}*
      %pathobject = "C:\WIS\Archived_Forecasts\HFREQ\"+%isic+%freq+%vintage+".csv"
      pagesave(type=text) %pathobject
      %tablea = "HFREQ"+%isic+%freq+%vintage+"_ATTR"
      %objectname = %wfname+"::"+%freq
      [b]%path0 = %wfname+"::"+%freq+"\"[/b]
      freeze {%path0}.table {%tablea}
      %pathtable ="C:\WIS\Archived_Forecasts\HFREQ\"+%table+".csv"
      %tablea.save(t=csv) %pathtable
      next
next


%path0 is were I am struggling right now as I don't know how to call the object, so that the program creates a table based on the detailed page view.

Thanks a lot in advance for your help!
Best,

Sam

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

Re: Freezing and Exporting Workfile Page

Postby EViews Gareth » Thu Feb 22, 2018 8:47 am

The wfdetails command has an out= option to save the details view into a table.
Follow us on Twitter @IHSEViews

SamChampanhet
Posts: 15
Joined: Thu Feb 05, 2015 8:56 am

Re: Freezing and Exporting Workfile Page

Postby SamChampanhet » Fri Feb 23, 2018 2:31 am

Thanks Gareth! It worked to the perfection!


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 19 guests