When new files are written, the character set of the work file is written to the catalog.
When the work file is written to a new file or an existing file with the character set *NONE
, the character set specified with the new CODE
operand or the character set of the work file becomes the character set for the file. If this character set is EDF03IRV
and the file previously had the character set *NONE
then the value *NONE
is retained.
If, on a write operation to an existing file with a character set not equal to *NONE
, the character sets of the file and work file are different (this occurs when a read-in file is written back after an explicit change of character set with @CODENAME or when an existing file is overwritten with new content), then an operand in the statements @CLOSE, @WRITE (format 1) and @XWRITE makes it possible to select the character set to be used for writing. If this operand is not specified then the write operation is rejected in batch mode. In interactive mode, the user is asked which character set is to be used.
If the file's character set is selected, EDT converts the work file before writing. If characters are present that cannot be depicted in the file's character set and if no substitute character has been defined (see @PAR SUBSTITUTION-CHARACTER), then the write operation is rejected with an error message. The user can then define the substitute character or modify the character set for writing and write the file again.