@Ksharp Thank you for your input here. It really helped and resolved my issue with data export to CSV.
Here is my code which works perfectly to my problem:
data have;
id=1; comment=catx('0D0A'x,'sa as','sdf sd','xcxd','v dfew');output;
id=2; comment=catx('0D0A'x,'w we','ghf','bv d','azx');output;
run;
data want;
set have;
* Count number of lines in a cell;
Cnt=countw(comment,'0D0A'x);
* Remove line breaks;
comment_new=compress(comment,'0D0A'X);
* Remove extra space and connect text in different lines by semicolon;
comment_new1=compbl(translate(comment,';','0D0A'X));
run;
... View more