The JOINBYTES function joins two or more text values as a single line.
JOINBYTES ignores any arguments that have a value of NA
and removes line breaks from the text it joins. (To preserve the breaks in a multiline text expression, use the INSCHARS function.) Also, when the length of the joined line exceeds 4,000 (that is, the maximum length of a joined line), JOINBYTES automatically breaks the line and puts the remaining bytes on the next line. The line break could occur between the two bytes of a double-byte character. JOINBYTES would then end one line with the first byte of the double-byte character and start the next line with the second byte of the character.
An expression to which JOINBYTES joins next-expression. When the first-expression has a data type other than TEXT or NTEXT, JOINBYTES converts it to TEXT. Use the CONVERT or TO_CHAR function to convert a NTEXT expression to TEXT.
One or more expressions to join with first-expression. When an expression you want to concatenate has a data type other than TEXT or NTEXT, JOINBYTES converts it to TEXT. Use the CONVERT or TO_CHAR function to convert a NTEXT expression to TEXT.
Example 7-135 Using JOINBYTES to Concatenate Values
This example shows how you can use JOINBYTES to combine text with the current values of the two variables name.product
and price
. The variable price
has a data type of DECIMAL; however, JOINBYTES automatically converts its value to TEXT to join it with the other text values.
LIMIT product TO 'Canoes' LIMIT month TO 'Dec96'
The JOINBYTES function
JOINBYTES('Current Price for ' name.product ' is: $' price)
returns the following value.
Current Price for Aluminum Canoes is: $200.03