Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@CREATE (format 2) - Assign string to string variable

&pagelevel(3)&pagelevel

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]

             

svarexNew 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
and assigned to a string variable.

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 CODE operand is used to define the character set UTF16 for the string variable #S01. The first line in the work file is converted from EDF041 to UTF16 and assigned to the string variable #S01.

(3)The character set EDF045 is defined for the work file.
(4)

The CODE operand is used to define the character set UTF16 for the string variable #S02. The third line in the work file is converted from EDF045 to UTF16 and assigned to the string variable #S02.

(5)

The character set UTF16, which is the character set of the strings #S01 and #S02, is implicitly defined for the string variable #S03. The contents of the string variables #S01 and #S02 are chained together and assigned to the string variable #S03.