Format 1 of the @CODENAME statement can be used to define the character set used by EDT for a work file or a string variable. The definition made in @CODENAME takes priority over the implicit selection of a character set by EDT, for example on the basis of an entry in the file catalog.
Operation | Operands | F mode, L mode |
@CODENAME | name [, { LOCAL | G LOBAL | $0...$22 | #S0...#S20}] [,FORCE={ Y ES | NO } ] |
name | Name of the character set that is to be defined. The character set name |
LOCAL | The specified character set is defined for the current work file. If the work |
GLOBAL | The specified character set is defined globally for all EDT work files. All The operand is primarily used if EDT is called as a subroutine via the old For the behavior of the old subroutine interface if no global character set is |
$0..$22 | The specified character set is defined for the specified work file. If the work |
#S0..#S20 | The specified character set is defined for the specified string variable. If the |
FORCE=NO | The data in the specified work file or string variable is converted into the |
YES | The specification |
If the work file is converted and if it contains characters which cannot be displayed in the target 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 @CODENAME statement is rejected and error message EDT5453
is output. Specifying GLOBAL does not, in this case, convert back work files which have already been converted.
If a character set is assigned to a work file or a string variable using @CODENAME then this assignment applies until it is explicitly modified by another @CODENAME statement or until the work file or string variable has been completely deleted (e.g. with @DELETE, format 2). This means that all the data that is copied or read into the work file or character set is converted into this character set (see section “Character sets in work files”).
If an ISAM file is opened for real processing in work file0
by means of the @OPEN statement (format 2) then every @CODENAME statement which applies explicitly or implicitly for this work file is rejected with message EDT5452
.
In the case of an opened, existing file for which the character set *NONE
is entered, calling the @CODENAME statement always causes the character set used for writing to be entered explicitly in the catalog when the file is written back with @CLOSE or @WRITE.