I am trying to combine two columns and add a enter or next line the values , can you help me ?
data test;
x="himom";
y="hidad";
;
run;
data want;
set test ;
length D $50 ;
d = catx('0D0A'x,x,y);
run;
proc print data=want;run;
Result i want :
newcolumn
-----------
himom
hidad
Where do you expect this to appear? It might be possible for some ODS destinations but it may be that the approach is different for different file types.
And basically isn't going to appear in a data set view.
I don't think there is a way for PROC PRINT to honor linefeed/carriage returns within the value of a single Cell.
I wonder if there are any PROC REPORT honchos seeing this question can provide a solution.
ENTER is a KEY, not a CHARACTER. I suppose the character you might want is a LINEFEED, '0A'x, or CARRIAGE RETURN, '0D'x.
But you are probably better off inserting something that PROC REPORT will recognize as a line break.
See this thread for example. https://communities.sas.com/t5/SAS-Procedures/Multiple-lines-in-a-PROC-REPORT-cell/td-p/312811
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.