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 If If the specified file cannot be accessed as required then the statement is |
CODE= | Defines the character set with which the POSIX file is to be written. If |
name | Character set of the POSIX file that is to be written. The name of a valid |
EBCDIC | The keyword |
ISO | The keyword |
MODE= | Specifies whether the file should or may already be present. If an open file |
ANY | If the file already exists then it is overwritten. Otherwise, it is created and |
UPDATE | The file that is to be written must already exist as otherwise the message |
NEW | The file is created and written. It must not already be present. Otherwise, |
REPLACE | Has the same meaning as 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.