The @SAVE statement fully or partially writes the content of the current work file to disk as an ISAM file.
Operation | Operands | F mode, L mode |
@SAVE | [file] [(ver)] [lines[,...]] [:cols[,...]:] [ {UPDATE | RENUMBER [line [(inc)] ] ] [OVERWRITE] } ] |
file | Name of the ISAM file that is to be written. The name must correspond to If the If the specified file cannot be accessed as required then the statement is If the file link name |
ver | Version number of the file that is to be overwritten. If an incorrect version |
lines | One or more line ranges that are to be written to the ISAM file. If lines are If |
cols | One or more column ranges which define the section to be written for each If no column range is specified then the lines are written in full. |
UPDATE | Specifying This operand is ignored if no ISAM file with the specified name exists. |
RENUMBER | New ISAM record keys are formed for the lines that are to be saved. The If If renumbering results in the maximum permitted line number |
line | Starting number for the new ISAM record keys that are to be formed. If |
inc | Increment for the new ISAM record keys that are to be formed. If |
OVERWRITE | An existing file of the same name is overwritten without any request for confirmation. If the specified file does not yet exist, |
If neither UPDATE
nor OVERWRITE
is specified and if a file with the same name already exists then, in interactive mode, EDT issues the query:
|
|
If the user answers the message with Y
then the existing file is overwritten as an ISAM file with the content of the current work file. In contrast, if the user answers N
then the file is not written and the message EDT0293
is output.
In batch mode, the file is always overwritten.
If an existing file is overwritten by @SAVE without the UPDATE
operand then the file type and file attributes may change. The file is written as an ISAM file with default attributes (e.g. variable record length unless a corresponding /SET-FILE-LINK
command with the file link name EDTISAM
and the divergent attributes has previously been issued (see chapter “File processing”). Files of the type PAM
or BTAM
cannot be overwritten.
The file is only opened temporarily during the write operation.
The character set used for the write operation depends on whether the file is overwritten, created or extended (see the UPDATE
operand.
If the file is overwritten or created then the data is written in the work file's character set and this character set is entered for the file in the catalog.
If the file is extended then the data is converted from the work file's character set into the character set specified in the file's catalog entry.
If the value *NONE
is entered for the file in the catalog then EDF03IRV
is used (see also section “Character sets”). If the work file contains characters which are invalid in the character set of the file that is to be written then these characters are replaced by a substitute character provided that such a character has been specified (see @PAR SUBSTITUTION-CHARACTER); otherwise, the file is not written and the error message EDT5453
is output.
This does not apply to invalid characters outside of the line or column range that is to be written. These are ignored.
If the work file contains lines that are too long for the file that is to be written (e.g. if the file has a fixed record length) or if the conversion operation creates any such records (possible in the case of Unicode character sets), then the write operation is aborted with the message EDT5444
.
If the statement is interrupted with [K2] and the EDT session is continued with /INFORM-PROGRAM
then the processing of the statement is aborted and message EDT5501
is output.
Note
If file
is specified then it is still possible, for reasons of compatibility, to abbreviate @SAVE to S
in F mode.