Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@XOPEN - Open and read a POSIX file

&pagelevel(3)&pagelevel

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 xpath operand can also be specified as a string variable. It must be
specified as a string variable if the path name contains characters which
have a special meaning in EDT syntax (e.g. blanks, semicolons in F mode
or commas).

If the specified file does not exist or cannot be accessed as required then
the statement is rejected with a corresponding error message.

CODE=

Defines the character set that is to be assumed for the POSIX file. Since it
is not possible to assign character sets to POSIX files in the POSIX file
system, a user specification is required here.

If CODE is not specified then the character set defined in @PAR CODE is
assumed. When EDT starts, the value EDF041 is set.

name

Character set of the POSIX file that is to be opened. The name of a valid
character set must be specified for name (see section “Character sets”).

EBCDIC

The keyword EBCDIC is now only supported for reasons of compatibility and
is a synonym for the character set EDF041.

ISO

The keyword ISO is now only supported for reasons of compatibility and is
a synonym for the character set ISO88591.

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.
Otherwise, it is created and opened for processing. This is the default value.

UPDATE

The file that is to be opened for processing and read in must already exist
as otherwise the message EDT5310 is output.

NEW

The file is created and opened for processing. It must not already be
present. Otherwise, the message EDT5311 is output.

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.