Language Reference |
performs elementwise string concatenation
where arguments are character matrices or quoted literals.
The CONCAT function produces a character matrix containing elements that are the concatenations of corresponding element strings from each argument. The CONCAT function accepts up to 15 arguments, where each argument is a character matrix or a scalar. All nonscalar arguments must conform. Any scalar arguments are used repeatedly to concatenate to all elements of the other arguments. The element length of the result equals the sum of the element lengths of the arguments. Trailing blanks of one matrix argument appear before elements of the next matrix argument in the result matrix. For example, suppose you specify the following matrices:
b={"AB" "C ", "DE" "FG"}; c={"H " "IJ", " K" "LM"};The following statement produces the new matrix , as shown:
a=concat(b,c);
A 2 rows 2 cols (character, size 4) ABH C IJ DE K FGLMQuotation marks (") are needed only if you want to embed blanks or maintain uppercase and lowercase distinctions. You can also use the ADD infix operator to concatenate character operands.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.