Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@GET - Read ISAM file

&pagelevel(3)&pagelevel

The @GET statement fully or partially reads an ISAM file from disk into the current work file.

Operation

Operands

F mode, L mode

@GET

[file] [(ver)] [lines[,...]] [:cols[,...]:] [NORESEQ]

file

Name of the ISAM file that is to be read in. The name must correspond to
the SDF data type <filename 1..54> or must consist of the special
specification '/'.

If there is as yet no local @FILE entry for the work file then, if the statement
is successful, the specified file name is entered as an implicit local @FILE
entry. If the file operand is not specified then, if present, the explicit local
@FILE entry and otherwise the global @FILE entry is used as the file name
(see also @FILE statement). If neither an explicit local nor a global @FILE
entry is defined (e.g. there is only an implicit local file entry) then the @GET
statement is rejected with the error message EDT5484.

If the specified file does not exist or 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 read this file (see chapter “File processing”).

ver

Version number of the file that is to be read. If the specified version number
does not match the file's version number, the message EDT0902 is output
and the file is read in nevertheless.

lines

One or more line ranges that are to be read in from the ISAM file. If symbolic
line numbers are specified then their values are determined from the current
work file and therefore usually have nothing to do with the record structure
of the file specified in file.

If lines is not specified, the entire file is read in.

The line numbers specified with lines always refer to the record keys even
if these are not taken over as line numbers. Consequently, if lines is
specified, a check is always performed for valid record keys (see NORESEQ).

cols

One or more column ranges which define the section to be read in from
each record. The ranges may repeat and overlap. The column specifications
refer to the characters in the file that is to be read in.
In the case of files which are present in a Unicode character set, they do not
usually correspond to the byte positions within a record. If column values
which exceed the record length are specified then blanks are read into the
work file in their place.
Columns are counted starting after the record key.

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

NORESEQ

The line numbers are formed from the ISAM keys of the ISAM files that are
read. When this is done, lines which have existing line numbers may be
overwritten.

In this case, EDT checks whether a valid line number is present in the
record key. To be valid, the key may consist only of the digits 0 to 9.
Otherwise, the @GET statement is aborted with the error message
EDT4984. The records read up to this point are taken over into the work file.
If a record has the key 0 then it is treated in the same way as a record with
1 (line number 0.0001) and the warning EDT2900 is issued.

If NORESEQ is not specified then the line numbers are assigned as a function
of the current line number and current increment (see section “Line number assignment”).

The file is only opened during the read operation. Records which consist solely of the key are read in as empty lines. If the file to be read in is empty, warning EDT2903 is output.

If the current work file is empty and has the character set *NONE then it is assigned the character set of the file that is to be read in. If this character set is *NONE then the work file is assigned the character set EDF03IRV.

If the work file already has a character set then the records that are to be read in are converted from the file's character set into the work file's character set. If the file that is to be read contains characters which cannot be displayed in the work file's character set then these characters are replaced by a substitute character provided that such a character has been specified (see @PAR SUBSTITUTION-CHARACTER); otherwise file read is aborted and error message EDT5453 is output. This also applies if there are invalid characters outside of the column range that is to be read. In contrast, invalid characters outside of the line range that is to be read in are ignored.

If the file is present in a Unicode character set and contains an illegal byte sequence, e.g. surrogate characters, then it will be impossible to read it even if SUBSTITUTION-CHARACTERS is specified. In this case, the read operation is rejected with the message EDT5454.

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 a attempt is made to use @GET to read a SAM file then EDT issues the error message EDT1902 and sets the switch for EDT errors. It nevertheless reads the specified file by performing an internal @READ for this file. In this case, the lines or NORESEQ operands are ignored.