Format 2 of the @CREATE statement is used to assign strings to string variables.
Operation | Operands | F mode, L mode |
@CREATE | svarex [:] [string[,...]] [,CODE=name] |
svarex | New string variable that is to be created. |
: | This must be specified if svarex cannot be unambiguously separated from string . |
string | One or more strings which are to be chained together in the specified order |
name | Character set that is to be defined for the specified string variable. |
During the first step, the character strings specified in string
are chained together. If all the strings involved have the same character set then the intermediate result is also assigned this character set. If the involved strings have different character sets then the intermediate result is assigned the character set UTFE
.
If, after conversion, the intermediate result exceeds the maximum length of 32768 characters then it is truncated to the maximum length and message EDT2400
is output.
If the CODE
operand is not specified then the content and character set of the intermediate result are assigned to the string variable.
If the CODE
operand is specified then this character set is assigned to the string variable and intermediate result is converted into the character set name
before being assigned to the string variable. If the string that is to be inserted contains characters which cannot be displayed in the character set specified in name
then these characters are replaced by a substitute character provided that such a character has been specified (see @PAR SUBSTITUTION-CHARACTER); otherwise, the @CREATE statement is rejected and error message EDT5453
is output.
If neither the string nor the CODE
operand is specified then the string variable is created with a blank and the character set EDF041
. If string
is not specified but the CODE
operand is then the string variable is created with a blank in the character set specified in the CODE
operand.
Example
@READ ’SRC.EDF041’ ------------------------------------------------------ (1) @CREATE #S01:1,CODE=UTF16 ----------------------------------------------- (2) @DELETE @READ ’SRC.EDF045’ ------------------------------------------------------ (3) @CREATE #S02:3,CODE=UTF16 ----------------------------------------------- (4) @CREATE #S03: #S01,#S02 ------------------------------------------------- (5)
(1) | The character set EDF041 is defined for the work file. |
(2) | The |
(3) | The character set EDF045 is defined for the work file. |
(4) | The |
(5) | The character set |