How to: |
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 Web page, 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.
From a report request, use
ON TABLE SAVE [AS filename] [FORMAT fmt] [MISSING {ON|OFF}]
or
save_field SAVE [AS filename] [FORMAT fmt] [MISSING {ON|OFF}]
After a report is executed, use
SAVE [AS filename] [FORMAT fmt] [MISSING {ON|OFF}]
where:
Is the name of the last field in the request, excluding BY or ACROSS fields.
Specifies a name for the SAVE file. If you do not specify a file name, SAVE is used as the default. Since each subsequent SAVE command overwrites the previous SAVE file, it is advisable to code a distinct file name in each request to direct the extracted data to a separate file, thereby preventing it from being overwritten by the next SAVE command.
Specifies the format of the SAVE file. ALPHA is the default format.
HTML, HTMTABLE, DHTML
ALPHA, DOC, PDF, WP
DIF, EXCEL, EXL2K, LOTUS, SYLK
COMMA, COM, COMT
For details about all available formats, see Choosing Output File Formats.
Ensures that fields with the MISSING attribute set to ON are carried over into the SAVE file. MISSING OFF is the default attribute. See Handling Records With Missing Field Values.
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:
From a request, use
ON TABLE SAVB [AS filename] [MISSING {ON|OFF}]
or
save_field SAVB [AS filename] [MISSING {ON|OFF}]
After a report is executed, use
SAVB [AS filename] [MISSING {ON|OFF}]
where:
Is the name of the last field in the request, excluding BY and ACROSS fields.
Specifies a name for the SAVB file. If you do not specify a file name, SAVB is used as the default. Since each subsequent SAVB command overwrites the previous SAVB file, it is advisable to code a distinct file name in each request to direct the extracted data to a separate file, thereby preventing it from being overwritten by the next SAVB command.
Ensures that fields with the MISSING attribute set to ON are carried over into the SAVB file. The default is MISSING OFF. See Handling Records With Missing Field Values.
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:
Information Builders |