The @XOPEN statement is used to open a POSIX file which is stored in the POSIX file system and read it into the current work file. This statement is now only supported for reasons of compatibility. In its place, users are recommended to use the @OPEN (format 1) statement with the operand POSIX-FILE
.
Operation | Operands | F mode, L mode |
@XOPEN | F ILE=xpath [, C ODE= { name | E BCDIC | I SO } ] [, M ODE={ ANY | U PDATE | N EW | R EPLACE } ] |
xpath | Path name of the POSIX file that is to be opened. The If the specified file does not exist or cannot be accessed as required then |
CODE= | Defines the character set that is to be assumed for the POSIX file. Since it If |
name | Character set of the POSIX file that is to be opened. The name of a valid |
EBCDIC | The keyword |
ISO | The keyword |
MODE= ANY | Specifies whether the file should or may already be present. If the file already exists then it is opened for processing and read in. |
UPDATE | The file that is to be opened for processing and read in must already exist |
NEW | The file is created and opened for processing. It must not already be |
REPLACE | If the file already exists then it is opened for processing. However, its previous content is deleted and is not read into the work file. If the file does not exist, it is created and opened for processing. |
If the current work file is not empty then the @XOPEN statement is rejected with the message EDT5191
. Unlike BS2000 files or library elements, POSIX files can be opened multiple times in different work files (in POSIX, files are not protected against being simultaneously opened by different tasks).
The records read from the file are inserted in the current work file after position 0.0000
using the procedure “Insertion between two lines” (see section “Line number assignment”).
If the empty work file has the character set *NONE
then it is assigned the character set specified in CODE
. If no character set is specified then the work file is assigned the character set defined using @PAR CODE.
If the empty work file already has a character set (e.g. due to a preceding @CODENAME) 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 in 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, the file is not read in and the error message EDT5453
is output.
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
When EDT is terminated (@HALT, @END, @RETURN), if a file is open due to
@XOPEN and the save query EDT0900
is output, then the POSIX file name is displayed in the form X=xpath
.