CONCAT: Concatenating Strings

How to:

CONCAT concatenates two strings. The output is returned as variable length alphanumeric.

Syntax: How to Concatenate Strings

CONCAT(string1, string2)

where:

string2

Alphanumeric

Is a string to be concatenated.

string1

Alphanumeric

Is a string to be concatenated.

Example: Concatenating Strings

The following request concatenates city names with state names. Note that the city and state names are converted to fixed length alphanumeric fields before concatenation.

DEFINE FILE WF_RETAIL_LITE
CITY/A50 = CITY_NAME;
STATE/A50 = STATE_PROV_NAME;
CONCAT_CS/A100 = CONCAT(CITY,STATE);
END  
 
TABLE FILE WF_RETAIL_LITE
SUM CITY AS City STATE AS State CONCAT_CS AS Concatenation
BY STATE_PROV_NAME NOPRINT
WHERE COUNTRY_NAME EQ 'United States'
WHERE STATE LE 'Louisiana'
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF,$
ENDSTYLE
END

The output is shown in the following image.