Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

String variables

&pagelevel(4)&pagelevel

String variables may be assigned any text such as a line in a work file. They can be accessed globally across work files. Every string variable has a content at all times since it is assigned the character ''BLANK'' (X'40') on initialization.

String variables always have a character set since they have a content at all times. Each string variable may have a different character set.

At EDT start time, string variables may be initialized by the S variables
SYSEDT-S00..SYSEDT-S20. If one or more of these S variables are present then their values are taken over into the corresponding string variable. At this point, it is not possible to specify a character set. The string variables are therefore assigned the initial character set EDF041 irrespective of whether they were initialized with ''BLANK'' or by S variables.

The @CREATE statement can be used to assign a new value to a string variable. In this case, the CODE=name operand can be used to specify the resulting character set explicitly. If CODE is not specified then the resulting character set is the character set of the value that is to be assigned. If this value is obtained by joining strings with different character sets then the umbrella character set UTFE is used.

The character set for a string variable can also be defined using the @CODENAME statement. @CODENAME name,#S0 converts the content of #S0 to the corresponding character set. This character set is assigned to the string variable. @CODENAME name #S0,FORCE=YES can be used to relabel the character set (only permitted in the case of 7-bit and 8-bit character sets).

The @SET statement can also be used to assign a value to a string variable. If this value is specified as a string then a new string variable is created. It is then assigned the character set of this string variable.
If the value is obtained from the content of an integer variable, the content of a line number variable or line number or from the name of a printable string variable, then the string variable, if newly created, is assigned the character set EDF041. If only a part of the content is overwritten then the intermediate result is converted into the character set of the string variable and inserted.
If a binary value is inserted then the string variable is always newly created and assigned the character set EDF041.