- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Good morning,
I need to insert a label with a line breack, is possible? I have to replicate an export in Excel with column headers that contain newlines like this:
"Matr.
S.I."
Please can you help me? I tried but in any case in te export results without a line breack....
many thanks to all.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Below one option.
data work.have;
col1='ABC';
col2=123;
run;
ods excel file="c:\temp\yourfile.xlsx";
%let lbl=Matr.%sysfunc(inputc(0A,hex.))S.I.;
proc print data=have label;
label col1="&lbl";
run;
ods excel close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Need to insert line break in Excel using PROC EXPORT
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Below one option.
data work.have;
col1='ABC';
col2=123;
run;
ods excel file="c:\temp\yourfile.xlsx";
%let lbl=Matr.%sysfunc(inputc(0A,hex.))S.I.;
proc print data=have label;
label col1="&lbl";
run;
ods excel close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Good morning everyone, I have verified your solution for which I thank you, but I have a problem: if the width of the excel cell is sufficiently wide the text dos not wrap. I need an action equal the excel comand "ALT + ENTER" to insert a line break, is it possible? It's very important for me... otherwise I'll have to reorganize a rather large DB.... Tnks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How are you creating an Excel file? Please show us the code.
If you are using PROC REPORT or PROC PRINT, there is the SPLIT= option which causes line breaks exactly where you want them to be. To have the text wrapped, there is also the FLOW= option in ODS EXCEL and the option in ODS EXCEL tagattr='wraptext:yes'
So to modify @Patrick 's code to use the SPLIT= option
ods excel file="c:\temp\yourfile.xlsx";
proc print data=have label split='~';
label col1="Matr.~S.I";
run;
ods excel close;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content