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.
data _null_;
x=' The Olym';
y='pic Arts Festi';
z=' val includes works by D ';
a='ale Chihuly.';
result=catt(x,y,z,a);
put result $char.;
run;
The following line is written to the SAS log:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
The Olympic Arts Festi val includes works by Dale Chihuly.
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 ..
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????????
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.
Also in the first iteration the value of X is a SPACE.
So what happens there? with CATT
Thanks
If the only character is a space, it is both a leading and trailing space. Since it is a leading space, CATT removes it.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.