Here is a table with variables that contain values of random lengths and random number of lines.
Q: Is there a way to export this to Excel from SAS so all values are visible inside a cell?
No wrapping, one line per value, cell width not that important.
It seems that ever since option autofit_height was removed, nothing works?
The EOL delimiter can be changed
data HAVE;
x = catx( '0D0A'x, '0000000000', '4445566778','9999999999','9991123456');
run;
ods excel file="&wdir\print.xlsx" options(sheet_name='Test');
proc print data=HAVE noobs ;
run;
ods excel close;
Setting cellwidth to force line wrapping as sometimes suggested does not look like a solution since it breaks lines randomly rather than where required.
Chris,
You could try option "tagattr=“ to avoid wrapping a line when you want to outpu an excel file.
Here is an example:
data HAVE;
x = catx( '0D0A'x, '0000000000', '4445566778','9999999999','9991123456');
run;
ods excel file="c:\temp\print.xlsx" options(sheet_name='Test');
proc report data=HAVE nowd ;
columns x;
define _all_/display style={tagattr="wrap:no"};
run;
ods excel close;
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →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.