String Expressions

  

DEVELOPER

The evaluation of a string expression results in an alphanumeric or wide value.  A string expression can be any of the following:

 

Concatenation (+) is the process of joining two or more strings together in the format:   

operand1 + operand2 + . . . + operandn

where:

operand1 . . . operandn are any valid alphanumeric or wide constants, variables, expressions, or operations.

The resulting value is of the same type as the operands.  When concatenating strings, the result of the concatenation will either be of type short alpha (for example, a string defined as less than or equal to 250 bytes in size), or of type long alpha (for example, a string defined as greater than 250 bytes in size).  The only time a concatenation will yield a long alpha is when the concatenation is immediately and explicitly assigned to a long alpha string.  Any other operations (even intermediate operations) will cause the string to be truncated to a short alpha.

Examples:

Assume:

A is a string of 200 bytes
B is a string of 200 bytes
C is an alpha field defined with size of 500 bytes (long alpha)
D is defined with size of 75 bytes (short alpha)
 

C=A+B

C=(ALPHA(WIDEVAL(A+B))

D=A+B

 

CITY + ',' + STATE

$A = 'XYZ', $B = '789'

ORDER-NO is an alphanumeric file variable with a length of 8

 

Comment on this topic

Topic ID: 520010