Command Reference : Command Reference
  
 
wfsave
Save the default workfile as an EViews workfile (.wf1 file) or as a foreign file or data source.
Syntax
wfsave(options) [path\]filename
wfsave(options) source_description [@keep keep_list] [@drop drop_list] [@keepmap keepmap_list] [@dropmap dropmap_list] [@smpl smpl_spec]
wfsave(options) source_description table_description [@keep keep_list] [@drop drop_list] [@keepmap keepmap_list] [@dropmap dropmap_list] [@smpl smpl_spec]
saves the active workfile in the specified directory using filename. By default, the workfile is saved as an EViews workfile, but options may be used to save all or part of the active page in a foreign file or data source. See wfopen for details on the syntax for source_descriptions and table_descriptions. Note, in particular, that you may use the byrow table_description for Excel 2007 files to instruct EViews to save the series by row (instead of the standard by column).
Options
Workfile Save Options
 
1
Save using single precision.
2
Save using double precision.
c
Save compressed workfile (not compatible with EViews versions prior to 5.0).
The default workfile save settings use the global options.
Foreign Source Save Options
 
type=arg, t=arg
Optional type specification: (see table below).
Note that ODBC support is provided only in the EViews Enterprise Edition.
mode=arg
Specify whether to create a new file, overwrite an existing file, or update an existing file. arg may be “create” (create new file only; error on attempt to overwrite) or “update” (only available for Excel files, and only if Excel is installed) (update an existing file, only overwriting the area specified by the range= table_description). If the “mode=” option is not used, EViews will create a new file, unless the file already exists in which case it will overwrite it.
maptype=arg
Write selected maps as: numeric (“n”), character (“c”), both numeric and character (“b”).
nomapval
Do not write mapped values for series with attached value labels (the default is to write the mapped values if available).
noid
Do not write observation identifiers to foreign data files (by default, EViews will include a column with the date or observation identifier).
nonames
Do not write variable names (only applicable to file formats that support writing raw data without variable names).
na=arg
String value to be used for NAs.
attr
Include object attributes (if the output type supports it). When specified, the first column will contain attribute names and each attribute value will be displayed after the name row.
The following table summaries the various formats along with the corresponding “type=” keywords:
 
 
Type Keywords
Supports Attributes
Access
“access”
 
Aremos-TSD
“a”, “aremos”, “tsd”
 
Binary
“binary”
 
dBASE
“dbase”
 
Excel (through 2003)
“excel”
Yes
Excel 2007 (xml)
“excelxml”
Yes
EViews Workfile
---
 
Gauss Dataset
“gauss”
 
GiveWin/PcGive
“g”, “give”
 
HTML
“html”
 
JSON**
“json”
 
Lotus 1-2-3
“lotus”
 
ODBC Dsn File
“dsn”
 
ODBC Data Source
“odbc”
 
MicroTSP Workfile
“dos”, “microtsp”
 
MicroTSP Mac Workfile
“mac”
 
RATS 4.x
“r”, “rats”
 
RATS Portable / TROLL
“l”, “trl”
 
SAS Program
“sasprog”
 
SAS Transport
“sasxport”
 
SPSS
“spss”
 
SPSS Portable
“spssport”
 
Stata (Version 7 Format)
“stata”
 
Tableau Data Extract
tde
 
Text / ASCII
“text”
Yes
TSP Portable
“t”, “tsp”
 
Note that if you wish to save your Excel 2007 XML file with macros enabled, you should specify an explicit filename extension of “.XLSM”.
**Also, while most output types only save objects from the current page, the JSON type will save all series objects from all pages of the current workfile and will ignore any @keep, @drop, and @smpl arguments.
Examples
wfsave new_wf
saves the current EViews workfile as “New_wf.WF1” in the default directory.
wfsave "c:\documents and settings\my data\consump"
saves the current workfile as “Consump.WF1” in the specified path.
wfsave macro @keep gdp unemp
saves the two series GDP and UNEMP in a separate workfile, “macro.WF1” in the default directory.
wfsave macro @dropmap gdp*
saves all of the series in the current workfile, other than those that match the name pattern “gdp*” in a workfile, “macro.WF1” in the default directory.
wfsave(type=excel) macro @keep gdp unemp
saves the two series GDP and UNEMP as an Excel 2003 file, “macro.xls” in the default directory.
wfsave(type=excelxml, mode=update) macro.xlsx range="Sheet2!a1" byrow @keep gdp unemp
will save the two series GDP and UNEMP into the existing Excel 2007 file “macro.xlsx”, specifying that the series should be written by row, starting in cell A1 on sheet Sheet2.
To save the latter file in a macro-enabled Excel 2007 file, you should specify the explicit filename extension “.XLSM”:
wfsave(type=excelxml, mode=update) macro.xlsm range="Sheet2!a1" byrow @keep gdp unemp
The command:
wfsave “<mydropboxdrive>”\folder\nipa.wf1”
will save the file to the cloud location MYDROPBOXDRIVE.
Cross-references
See “Workfile Basics” for a discussion of workfiles.
See also pagesave, wfopen, and pageload.