Page 1 of 1
Write Command - Using Wildcards to Dump Specific Series
Posted: Mon Sep 07, 2009 9:10 am
by MT_MANC
Is there a specific wildcard syntax for the "Write" command when specying particular Series to be dumped to a Lotus .wk1 file ?
I'm trying to avoid having to type out lines 2 & 3 in entirety in PRG code snippet below; the obvious use of " *_sa" or "CBI*_sa" both get an error message !
Code: Select all
WRITE(B2,t=WK1,na="",dates) c:\data\WS3\COI_CBIrts_index_SA.wk1 _
CBIconfi_nw_sa CBIoutpi_nw_sa CBIoutfi_nw_sa CBInopi_nw_sa CBInofi_nw_sa CBInxopi_nw_sa CBInxofi_nw_sa CBIbcapi_nw_sa _
CBIconfi_ne_sa CBIoutpi_ne_sa CBIoutfi_ne_sa CBInopi_ne_sa CBInofi_ne_sa CBInxopi_ne_sa CBInxofi_ne_sa CBIbcapi_ne_sa
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Mon Sep 07, 2009 9:22 am
by EViews Gareth
Try using wfsave rather than write.
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Tue Sep 08, 2009 4:24 am
by MT_MANC
Gareth
Most Kind
I tried various syntaxes of wfsave (no examples in eVIEWS Command Reference)
I want to dump all varialbles ending in "_sa" over the entire sample period to an external worksheet (ideally to .wk1 but no such format seems permissable ?, so Excel used instead)
Code: Select all
wfsave (type=excel) "C:\data\WS_COI\CBIrts_index_SA.xls" @keep *_sa @smpl all
..causes Eviews 6 to crash, as does:
Code: Select all
wfsave (type=excel) "C:\data\WS_COI\CBIrts_index_SA.xls" @keep *_sa @smpl 1970:1 2020:4
Q. Are there any more examples anywhere to edit as required (couldnt see any in Forum OR search of Google) ?
Q. I presume dumping large workfile to multi-sheet workbook is not (yet) possible ?
Thanks again
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Tue Sep 08, 2009 8:16 am
by EViews Gareth
Something simple like
Code: Select all
wfsave "C:\data\WS_COI\CBIrts_index_SA.wk1" @keep *_sa
is all you should need.
The examples under WFOPEN are generally applicable to WFSAVE.
I don't understand what you mean by your large workfiles question.
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Tue Sep 08, 2009 9:17 am
by MT_MANC
Thanks- this almost works but how can I get the .wk1 dump to display (quarterly) dates down the leftmost column
as happens with WRITE command (which CANNOT use wildcards) ?
I'm presuming that the above Wildcards CANNOT be used in "For:Next" loop with String Variables ?
eg following will fail....
Code: Select all
for %x4 CNO*_nw
{%x4}.x12(mode=a,save="d10 d11 d12")
next
...but this will work:
Code: Select all
for %x4 CNOoutp_nw CNOordp_nw CNOinp_nw CNOinp_nw
{%x4}.x12(mode=a,save="d10 d11 d12")
next
"Large wf" - where no of series selected for dumping (via wildcards) exceeds 256 (= max no. of columns of single Lotus/Excel worksheet)
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Tue Sep 08, 2009 9:36 am
by EViews Gareth
No, a wildcard cannot be used in loops. However you can make a group using the wildcard, then loop through the members of the group.
There is no way to get EViews to write into different sheets for large files.
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Tue Sep 08, 2009 10:17 am
by MT_MANC
Most Kind
wfsave - how can I get the .wk1 dump to display (quarterly) dates down the leftmost column
(as happens with WRITE command )
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Tue Sep 08, 2009 10:43 am
by EViews Gareth
Sorry, missed that question first time.
That's actually a bit more complicated (only slightly though). Use the following:
Code: Select all
alpha dates = @datestr(@date)
wfsave "C:\data\WS_COI\CBIrts_index_SA.wk1" @keep dates *_sa
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Wed Sep 09, 2009 3:19 am
by MT_MANC
Gareth
I've adapted this slightly:
Code: Select all
alpha dates = @datestr(@date,"YYYY[Q]Q")
wfsave "C:\data\WS_COI\CNO_raw_SA.wk1" @keep dates CNO*_sa
to give me dates in "1970Q1" format - thanks again
...but any hints to prevent "NA" being dumped in .wk1 where data/forecast value missing
ie replacing "NA" with "" ie empty cell in wk1 dump ("Write" function seems to have this as an option but not wfsave ? )
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Fri Sep 11, 2009 5:47 am
by MT_MANC
Gareth
Not sure if your saw my final question on wfsave function:
..any hints to prevent "NA" being dumped in .wk1 where data/forecast value missing
ie replacing "NA" with "" ie empty cell in wk1 dump ("Write" function seems to have this as an option but not wfsave ? )
Thanks again
Re: Write Command - Using Wildcards to Dump Specific Series
Posted: Fri Sep 11, 2009 6:25 am
by EViews Gareth
I don't think there is a way to do that with WFSAVE.