Page 1 of 1

Freezing and Exporting Workfile Page

Posted: Thu Feb 22, 2018 7:00 am
by SamChampanhet
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

Re: Freezing and Exporting Workfile Page

Posted: Thu Feb 22, 2018 8:47 am
by EViews Gareth
The wfdetails command has an out= option to save the details view into a table.

Re: Freezing and Exporting Workfile Page

Posted: Fri Feb 23, 2018 2:31 am
by SamChampanhet
Thanks Gareth! It worked to the perfection!