0 / 0
Concatenating strings in DataStage

Concatenating strings in DataStage

You can concatenate strings by using the concatenation operator.

The concatenation operator, : or Cats, links string expressions to form compound string expressions. For example, if x has a value of Tarzan, this expression:


"Hello. " : "My Name is " : X : ". What's yours?"

evaluates to:


"Hello. My name is Tarzan. What's yours?"

Multiple concatenation operations are normally performed from left to right. You can change the order of evaluation by using parentheses. Parenthetical expressions are evaluated before operations outside the parentheses.

Numeric operands in concatenated expressions are considered to be string values. Arithmetic operators have higher precedence than the concatenation operator. For example:


"There are " : "2" + "2" : "3" : " windows."

has the value:


"There are 43 windows."

The result of any string operation that involves the null value is a null value. But if the null value is referenced as a character string that contains only the null value (that is, as the string CHAR(128)), it is treated as character string data. For example, this expression evaluates to null:


"A" : @NULL ;*concatenate A with @NULL system variable

But this expression:


"A" : @NULL.STR ;*concatenate A with @NULLSTR system variable

evaluates to "A<CHAR128>".

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more