12-04-2013 12:19 PM
Can someone ecplain How the CATT is working???
i dint understand what is given in the Documentation
The following example shows how the CATT function concatenates strings.
x=' The Olym';
y='pic Arts Festi';
z=' val includes works by D ';
put result $char.;
The following line is written to the SAS log:
The Olympic Arts Festi val includes works by Dale Chihuly.
12-04-2013 12:41 PM
CATT only removes TRAILING blanks. So the double spaces in X are not affected by the concatenation. Likewise the space at the start (a leading blank) of Z remains leaving the "Festi val" in the result. But the space after D in Z is removed so the result is Dale ..
12-04-2013 01:02 PM
I get your point.
if in this example if i=1
x=catt(x,' t_',left(i),' d_',left(i));
I am getting space t_1SPACEd_1 since a leading space is introduced fot t_ and d_????
if that leading space was not introduced i would have got t_1d_1t_2d_2 etc etc
Is my understanding of this right????????
12-04-2013 03:29 PM
It looks like you have it. If you don't want either leading or trailing spaces then use CATS, if you don't want leading or trailing spaces from the components of the concatenation but want to add a delimiter between the pieces then use CATX.