When accessing an existing ISAM file, any printer control character specification in the catalog is ignored. Moreover, in the case of ISAM files with variable record length, the explicit specification of a record length in the catalog is ignored.
When EDT writes to a new ISAM file, this file is usually stored with the following default attributes:
variable record length without record length specification,
key position 5,
key length 16 in the case of files with the character set
UTF16
or key length 8 in the case of files with a different character set andblock size 2 for files on NK4 disks or block size 1 otherwise. If when the file is opened, the longest record that is to be written to it does not fit in this block size then a larger block size (maximum 16) is used.
By default, no multiple keys are permitted on writing.
If the attributes of new files shall differ from these default values then the file attributes and a file link name must be stored in the Task File Table
before the file is written and the write operation must be performed using this file link name.
However, only the attributes described in section “File link names” are evaluated.
Usually, the files that are to be processed by EDT are read (fully or partially) into work files. It is also possible to process ISAM files directly on disk (real processing). This can only be done in work file 0.
File names used in EDT statements must comply with the requirements of the BS2000 data management system. EDT checks the validity of file names.
EDT is able to process records which consist solely of the ISAM key.
When ISAM files are processed, the ISAM key can be read in as a line number, read into the work file's data area (as line content) or completely ignored.
On a write operation, the ISAM key can be formed from the line number or taken over from the data area.
If the ISAM key is to be retained it must therefore first be taken over as a line number or into the data area and must not be modified by EDT statements.
If the ISAM key is taken over as a line number when read in, it must be numerical (each of the 8 characters belongs to the range 0..9
) and the key 00000000
is not permitted.
If the file's key length is shorter than 8 (or 16 in the case of UTF16
files) and if the line number is formed from the ISAM key then the line number is left-filled with zeros. For example, in the case of a KEY-LENGTH
specification of 4, the ISAM key 1234
would be taken over as line number 0000.1234
.
If the file's key length is shorter than 8 (or 16 in the case of UTF16
files) and if the ISAM key is formed from the line number then the line number is truncated at the left. For example, in the case of a KEY-LENGTH
specification of 4, the line number 1234.5678
would be written as the ISAM key 5678
. It is not therefore always possible to guarantee that the ISAM key is unique. If multiple keys are permitted when writing to the file, then work file records for which the same ISAM key was generated are written to the file. Otherwise, the write operation is aborted and the message EDT4208
(DMS error code OAAF
) is output.
The only way to process ISAM files with non-standard key positions (!=
5 for variable record lengths or !=
1 for fixed record lengths), with a key length greater than that specified as the default, with non-numerical keys or with duplicate key values is to take the ISAM key over into the data area.
If the ISAM key is located in the data area and modified in EDT, if lines are swapped or records inserted, then the user must make sure that the sequence of work file records corresponds to the sequence of ISAM keys as otherwise the write operation will be rejected with the message EDT4208
(DMS error code 0AAB
).
In the case of ISAM files with duplicate key values (duplicate keys
), it is possible to read in all the records provided that the key is not taken over as a line number. If the ISAM key is taken over as a line number then only the last record with the same key is read in.
In order to process such files, the key should therefore also be taken over into the record. When files with multiple keys are written, the attribute DUPLICATE-KEY=YES
must be stored in the Task File Table
.
It is not possible to process ISAM files with the character set UTF16
and a fixed, oddnumbered record length or an odd-numbered key length.
The definitions of any secondary keys in an ISAM file (in a secondary index) are retained if the file is processed using the @OPEN and @CLOSE statements and the key fields are not modified inconsistently in the data area.
If inconsistent changes are made, the message EDT5246
is output and the secondary index is deleted. The secondary index is also deleted if the file is fully overwritten with the @SAVE or @WRITE (format 2) statement (but not in the case of UPDATE
).