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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.Register now and lock in 2025 pricing—just $495!
Register now
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.