Hello,
Please help me with the below question I came across :-
Q. How can you create output with headings that break as shown below (Using PROC REPORT) ?
style of Average Maximum
house Bedrooms Baths
CONDO 2.75 2.5
RANCH 3 3
SPLIT 2 2
I suppose, we have to use the SPLIT= option here in column headings in DEFINE statements. But, I found the solution which says - 'These headings split this way be default'.
Could anyone please explain ?
Thank you!
Hi:
In the LISTING window, the wrapping of the header text occurs at the column width. You can see in the comparison of the LISTING window that there is a difference between HTML output (the default) and LISTING output. So, when asked a question like this, it is always important to clarify - -what destination is the output being sent to. LISTING is no longer the default destination, HTML is the default, since SAS 9.2. So if you want to be explicit and control where the headers break, no matter what destination, then use the SPLIT= option in either PROC PRINT or PROC REPORT. Otherwise, if you only want LISTING, then rely on the defaults. I prefer the method of explicitly using SPLIT= because then there is no doubt about what is controlling the header lines.
cynthia
Have you tried to produce the report yourself? Automatic splitting depends on the output format. Using the listing format, eight chars is default width for a column.
Yes, I did try this code for myself, and I saw no splitting. But, the solution being shown says that the splitting is default as per the length of the particular numeric/character field.
If you use ODS to create the report then try using
ODS escapechar = option.
I know it works with titles anf footnotes.
Try using it with proc report heading.
remark - I have no experience with it.
usage as:
ods escapechar = '~';
footnote ' long text ~n more text';
Hi:
In the LISTING window, the wrapping of the header text occurs at the column width. You can see in the comparison of the LISTING window that there is a difference between HTML output (the default) and LISTING output. So, when asked a question like this, it is always important to clarify - -what destination is the output being sent to. LISTING is no longer the default destination, HTML is the default, since SAS 9.2. So if you want to be explicit and control where the headers break, no matter what destination, then use the SPLIT= option in either PROC PRINT or PROC REPORT. Otherwise, if you only want LISTING, then rely on the defaults. I prefer the method of explicitly using SPLIT= because then there is no doubt about what is controlling the header lines.
cynthia
Thank you for the detailed explanation 🙂
Thanks everyone for your answers. 🙂
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.