Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@CODENAME (format 1) - Define the character set for work files and string variables

&pagelevel(3)&pagelevel

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
must be known in XHCS; otherwise, the statement is rejected with message
EDT4980. The specified character set is defined for one or more work files
or for the string variable determined by means of the other operands.

LOCAL

The specified character set is defined for the current work file. If the work
file is not empty and the operand FORCE=YES is not specified then the data
it contains is converted into the new character set.

GLOBAL

The specified character set is defined globally for all EDT work files. All
nonempty work files are converted unless the operand FORCE=YES has been
specified. This setting does not apply to character sets for string variables.

The operand is primarily used if EDT is called as a subroutine via the old
subroutine interface (V16 format). If EDT recognizes that the same
character set is defined for all the work files then this character set is
entered in the global control block EDTPARG at the old subroutine interface.
If the calling program evaluates this entry, it is therefore advisable to use the
GLOBAL operand to define the same character set for all the work files (and
then not to change these again afterwards).

For the behavior of the old subroutine interface if no global character set is
defined and further details concerning the use of character sets at the
subroutine interface, see the Subroutine Interfaces User Guide [1].

$0..$22

The specified character set is defined for the specified work file. If the work
file is not empty and the operand FORCE=YES is not specified then the data
it contains is converted into the new character set.

#S0..#S20

The specified character set is defined for the specified string variable. If the
operand FORCE=YES is not specified then the data present in the string
variable is converted into the new character set.

FORCE=NO

The data in the specified work file or string variable is converted into the
specified character set.

   YES

The specification FORCE=YES is only permitted for 7 and 8-bit character sets
and results in the relabeling of the specified work file or string variable, i.e.
the content of the work file or string variable remains unchanged (as a byte
sequence) but is reinterpreted in the specified character set. This function
is used to correct errors in the assignment of character sets, for example
due to incorrect entries in the DMS catalog. In the case of Unicode
character sets, the statement is rejected with the message EDT5494.

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.