DATA Step, Macro, Functions and more

Splitting heading in proc report

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Splitting heading in proc report

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!


Accepted Solutions
Solution
‎02-07-2017 10:39 PM
SAS Super FREQ
Posts: 8,742

Re: Splitting heading in proc report

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

compare_listing_other.png

View solution in original post


All Replies
Contributor
Posts: 33

Re: Splitting heading in proc report

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.

Contributor
Posts: 22

Re: Splitting heading in proc report

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.

Trusted Advisor
Posts: 1,369

Re: Splitting heading in proc report

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';
Solution
‎02-07-2017 10:39 PM
SAS Super FREQ
Posts: 8,742

Re: Splitting heading in proc report

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

compare_listing_other.png

Contributor
Posts: 22

Re: Splitting heading in proc report

Thank you for the detailed explanation :-)

 

Thanks everyone for your answers. :-)

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 214 views
  • 0 likes
  • 4 in conversation