The length of a character variable is set the first time the data step meets the variable. Therefore, make sure that the length of the variable is large enough to meet your needs.
As a small example, here:
data test1;
string="abc";output;
string=" my name is alphapet and place is world ";output;
run;
the length of String is three. Therefore the string you want to have in a variable is truncated. Instead, we can make sure the no truncation happens by setting a large enough length like this
data test2;
length string $200;
string="abc";output;
string=" my name is alphapet and place is world ";output;
run;