Concatenation Conversion (C)

Concatenation Conversion (C)

Top  Previous  Next

 

The concatenation conversion code concatenates data items, optionally inserting separators between them. It behaves identically for input conversion with ICONV() and output conversion with OCONV().

 

The general form of a concatenation conversion code is

C{;} c expr c expr ...

where

 

cis the separator. This may be any single character except for a digit, a mark character, a quote or a backslash. A semicolon specifies that no separator is to be inserted. Where c is a space or semicolon and the next character is also a space or semicolon, this is treated as a further separator, allowing insertion of multiple spaces.

 

expris the data to be inserted and may be:

a field number. This will be extracted from the current content of @RECORD or from @ID if zero.

a string enclosed in single quotes, double quotes or backslashes.

an asterisk to substitute the data supplied in the conversion function call.

 

 

Examples

 

If @RECORD contains F1FMF2FMF3 and @ID contain 21:

 

Operation

Result

OCONV('abc', 'C;3;"xxx";1')

F3xxxF1

OCONV('abc', 'C;3;1')

F3F1

OCONV('abc', 'C;"aaa"1"bbb"')

aaaF1bbb

OCONV('abc', 'C;1    2')

F1    F2

OCONV('abc', 'C;1*2')

F1*F2

OCONV('abc', 'C;1**')

F1*abc

OCONV('abc', 'C;   3')

  F3

OCONV('abc', 'C;0=1')

21=F1