Var New Var
A A
B AB
C ABC
D ABCD
can anyone explain how to get this answer with using retain statement or other option
Thank you
Unnati
HOw about something like this?
data have; input Var:$1; datalines; A B C D ; data want; set have; length NewVar $4; retain NewVar; NewVar=CATS(NewVar,Var); run;
View solution in original post
data have; do _n_=65 to 68; var=byte(_n_); output; end; run; data want; set have; length want $10; retain want; want=cats(want,var); run;
Hi @unnati it;s plain vertical concatenation. Just a matter of time before you get the understanding. HTH
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Submit your idea!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.