OPEN DATASET - position
... AT POSITION pos ... .
This addition sets the file pointer at the position specified in
pos expects a numerical data object. Numbers with a value greater than the
value range of the data type
i can also be entered.
The position is specified in bytes; the start of the file corresponds to position 0. If
contains the value -1, the position is at the end of the file. For all other negative values, the behavior is undefined.
Note the following special cases:
posis greater than the length of the file, the file pointer is positioned outside the file. Unless the position is changed, no data can be read. If write changes are made to a file opened for reads by a non- Unicode program, the file is padded with hexadecimal 0 from the end of the file to the specified position, and the write change is made after this position.
posis greater than the length of the file, the next time the file is written in, it is filled with hexadecimal 0 from the end of the file to the specified position, and the new content is written after that.
For file sizes larger than 2 GB, a position
posof the data type
iis not sufficient for positioning in the whole file, and
decfloatmust be used instead.
The positioning can be overwritten by the statement
SET DATASET. In particular, for positioning the file pointer at the end of the file,
SET DATASETshould be used instead of entering the value -1 in
Free position specifications are more suitable for binary files than for text files. In the case of text files, positions depend on the character format,
end-of-line marking, and a possible byte order mark (BOM) in UTF-8 files.