Previous Topic: $SQRT FunctionNext Topic: $SUBSCRIPTPOSITION Function


$STRING Function

$STRING returns an alphanumeric value obtained from the series of parameters by concatenating the values obtained for each parameter.

This function has the following format:

$STRING (parm1,...,parmn)
parm‑1,...,parm‑n

Defines the items to concatenate (after conversion to alphanumeric expressions, if necessary). An expression must be one of those described follows. If any items contain null values, the concatenated string returns null values. The actions of $STRING vary with the parameter type as follows:

Note: You must specify each occurrence of fields that are defined as repeating fields (defined with OCCURs) with a subscript.

Examples

$STRING ('ABC', 'DEF')            : result is 'ABCDEF'

Assume G is a group that contains I, J, K.

Assume I is an unsigned numeric field with three digits and two decimal places.

Assume J is a signed numeric field with six digits.

Assume K is an alphanumeric elementary five‑character item.

SET I = 34.5
SET J = ‑123
SET K = 'HELLO'
$STRING (I)      : result is '  34.50'
$STRING (J)      : result is '   ‑123'
$STRING (K)      : result is 'HELLO'
$STRING (I,J)    : result is '  34.50   ‑123'
$STRING (J,K)    : result is '   ‑123HELLO'
$STRING (G)      : result is '  34.50   ‑123HELLO'
$STRING (I,J,K)  : result is '  34.50   ‑123HELLO'

$STRING(G) and $STRING(I,J,K) are equivalent.

$STRING ('*' $SUBSTR('ABCDE' START=2,LENGTH=3) $SPACE K '*')
                 : result is '*BCD HELLO*'