Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@XWRITE - Save content of current work file in a POSIX file

&pagelevel(3)&pagelevel

The @XWRITE statement can be used to write the content of the current work file to a POSIX file. The work file is retained. This statement is now only supported for reasons of compatibility. In its place, users are recommended to use the @WRITE (format 1) statement with the operand POSIX-FILE.

Operation

Operands

F mode, L mode

@XWRITE

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 written.

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 xpath is not specified then a POSIX file opened with @XOPEN or
@OPEN (format 1) is written back. If there is no open POSIX file then the
statement is rejected with the message EDT5122.

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

CODE=

Defines the character set with which the POSIX file is to be written.

If CODE is not specified then the file is written in the character set defined in
@PAR CODE (including when writing back files that were opened with
another character set). When EDT starts, the value EDF041 is set.

name

Character set of the POSIX file that is to be written. 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=

Specifies whether the file should or may already be present. If an open file
is to be written back, this operand is ignored.

ANY

If the file already exists then it is overwritten. Otherwise, it is created and
written. This is the default value.

UPDATE

The file that is to be written must already exist as otherwise the message
EDT5310 is output.

NEW

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

REPLACE

Has the same meaning as ANY. If the file already exists then it is overwritten.

Otherwise, it is created and written.

If a POSIX file has been opened with @XOPEN or @OPEN (format 1) then it is not necessary to specify the file name in @XWRITE. The content of the opened file is replaced by the content of the work file. The file remains open until @CLOSE is issued.

If the work file is converted before writing and if it contains characters which are invalid in the character set used by the file that is to be written 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 written and error message EDT5453 is output. The user can then define a substitute character or modify the character set for writing and run @XWRITE again.

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.

Caution

Since the default setting is MODE=ANY, existing files are overwritten without any warning being issued if MODE is not specified.