Neue Zusätze für die Dateischnittstelle

Overview

1. Opening files
2. Reading data
3. Writing data
4. File attributes



1. Opening files

OPEN DATASET dsn IN TEXT MODE.

The file is opened so that it can be read or written to line-by-line. Final space characters are deleted in this mode.

OPEN DATASET dsn IN BINARY MODE.

The file is opened to be read or written to, without any line breaks. In both the Unicode system and the non-Unicode system, the exact content of memory is copied.

OPEN DATASET dsn IN LEGACY TEXT MODE.

The file is opened so that it can be read or written to line-by-line, in a format compatible with TEXT MODE in the non-Unicode system.

OPEN DATASET dsn IN LEGACY BINARY MODE.
The file is opened to be read or written to without any line breaks, in a format compatible with non-Unicode system BINARY MODE. The additions ENDIAN and CODE PAGE are used as described above. You can also specify a REPLACEMENT CHARACTER,  rc, in this variant.

Note
For each of the above variants, you can use the IGNORING CONVERSION ERRORS addition to make the system suppress conversion errors at runtime when reading or writing to a file. In general, reading or writing to a file causes a runtime error, unless this file has already been opened using an OPEN DATASET statement.

2. Reading data

READ DATASET dsn INTO f [ LENGTH len ] ...

The ... LENGTH len addition specifies the length of the file in characters (for a text-mode file), or in bytes (for other file types).

3. Writing data

TRANSFER f TO dsn [ LENGTH len ] ...

The ... LENGTH len addition specifies the length of the file in characters (for a text-mode file), or in bytes (for other file types).

4. File attributes You can obtain the attributes of a file at runtime, using the GET DATASET or change them using SET DATASET.