Creating SAVE and SAVB Files
The SAVE command, by default, captures report output in ALPHA format as a simple sequential data source, without headings or subtotals. However, you can specify a variety of other formats for SAVE files, which are compatible with many software products. For example, you can specify SAVE formats to display report output in a webpage, a text document, a spreadsheet or word processing application, or to be used as input to other programming languages. For a list of supported formats, see Choosing Output File Formats.
Regardless of format, the SAVE command does not create a Master File.
The SAVB command is a variation on the SAVE command. SAVB creates a data source without a Master File, but numeric fields are stored in BINARY format. You can use the SAVB file as input to a variety of applications. SAVB output is the same as the default output created by the HOLD command.
Create a SAVE File
ON TABLE SAVE [AS filename] [FORMAT fmt] [MISSING {ON|OFF}]
or
save_field SAVE [AS filename] [FORMAT fmt] [MISSING {ON|OFF}]
where:
You can also include a path, enclosed in single quotation marks, indicating where to store the SAVE file. For example:
ON TABLE SAVE FILENAME 'install_dir:\dir\filename.ext' FORMAT fmt
- To display
as or in a webpage:
HTML, HTMTABLE, DHTML
- To use in a
text document:
ALPHA, DOC, PDF, WP
, Text
- To use in a
spreadsheet application:
DIF, EXCEL, EXL2K, LOTUS,
(WK1),
SYLK - To use in a
database application:
COMMA, COM, COMT
For details about all available formats, see Choosing Output File Formats.
Creating a SAVE File
The following request extracts data from the EMPLOYEE data source and creates a SAVE file.
TABLE FILE EMPLOYEE PRINT LAST_NAME AND FIRST_NAME BY DEPARTMENT ON TABLE SAVE END
A description of the ALPHA (default SAVE format) file layout appears after the records are retrieved.
The output is:
Create a SAVB File
ON TABLE SAVB [AS filename] [MISSING {ON|OFF}]
or
save_field SAVB [AS filename] [MISSING {ON|OFF}]
where:
You can also include a path, enclosed in single quotation marks, indicating where you wish to store the SAVB file. For example:
ON TABLE SAVB FILENAME 'c:\dir\filename.ext '
Creating a SAVB File
The following request extracts data from the SALES data source and creates a SAVB file.
TABLE FILE SALES PRINT PROD_CODE AND AREA BY DATE WHERE CITY IS 'STAMFORD' OR 'UNIONDALE' ON TABLE SAVB END
A description of the BINARY file is appears after the records are retrieved.
The output is: