Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@SAVE - Write as ISAM file

&pagelevel(3)&pagelevel

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
the SDF data type <filename 1..54> or must consist of the special
specification '/'.

If the file operand is not specified then the explicit local @FILE entry is
used as the file name if present. If not, the global @FILE entry is used and,
failing this, the implicit local @FILE entry (e.g. from the @GET statement)
(see also @FILE statement). If there is neither a local nor a global @FILE
entry then the @SAVE statement is rejected with the error message
EDT5484.

If the specified file cannot be accessed as required then the statement is
rejected with a corresponding error message.

If the file link name EDTISAM is assigned to a file then the user simply needs
to specify '/' in order to write this file (see chapter “File processing”).

ver

Version number of the file that is to be overwritten. If an incorrect version
number is specified for an existing file then the statement is rejected with
EDT4985. If the file does not yet exist then this specification is ignored and
version 001 of the file is written.

lines

One or more line ranges that are to be written to the ISAM file. If lines are
specified more than once then they are also written more than once.

If lines is not specified, then the entire file is written.

cols

One or more column ranges which define the section to be written for each
record. The ranges may repeat and overlap. The column specifications
refer to the characters in the current work file. If column values which exceed
the work file record length are specified then blanks are written to the file in
their place.

If no column range is specified then the lines are written in full.

UPDATE

Specifying UPDATE causes the lines that are to be saved to be inserted in
the ISAM file. In the ISAM file, EDT only overwrites the lines whose
numbers also exist in the current work file and which are located in the
range specified with lines. The remaining lines in the ISAM file are
retained.

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
line numbering in the work file remains unchanged. If lines are output more
than once (due to overlaps in the range specifications) then they are also
entered in the file multiple times (with different record keys).

If RENUMBER is not specified then the ISAM keys result from the line
numbers of the lines that are to be saved. If the file is to be read
subsequently with @GET ... NORESEQ and is to have the same line numbering
as at the time it was saved then RENUMBER must not be specified.

If renumbering results in the maximum permitted line number
(corresponding to the key length) being overwritten then the statement is aborted
with error message EDT5252.

line

Starting number for the new ISAM record keys that are to be formed. If line
is not specified then the value 1 is used.

inc

Increment for the new ISAM record keys that are to be formed. If inc is not
specified then the increment implicitly specified by line is used (see
section “Implicit increment assignment”).

OVERWRITE

An existing file of the same name is overwritten without any request for confirmation. If the specified file does not yet exist, OVERWRITE has no effect.

 

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:

%

%

EDT0903 FILE 'file' IS IN THE CATALOG, FCBTYPE = fcbtyp

EDT0296 OVERWRITE FILE? REPLY (Y=YES; N=NO)?

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.