SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PoojaP1
Fluorite | Level 6

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

undefined

View solution in original post

5 REPLIES 5
error_prone
Barite | Level 11

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.

PoojaP1
Fluorite | Level 6

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.

Shmuel
Garnet | Level 18

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';
Cynthia_sas
SAS Super FREQ

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

undefined

PoojaP1
Fluorite | Level 6

Thank you for the detailed explanation 🙂

 

Thanks everyone for your answers. 🙂

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4335 views
  • 1 like
  • 4 in conversation