BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
metallon
Pyrite | Level 9

Hi,

is there a way to do a linebreak for a long custom LABEL name for a sas data set variable?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

That is what the SPLIT= option on PROC PRINT is designed for. 

SPLIT='split-character'

specifies the split character, which controls line breaks in column headings. It also uses labels as column headings. PROC PRINT breaks a column heading when it reaches the split character and continues the header on the next line. The split character is not part of the column heading although each occurrence of the split character counts toward the 256-character maximum for a label.

Alias:S=
Interaction:You do not need to use both LABEL and SPLIT= because SPLIT= implies the use of labels.
Interaction:The OBS= option honors the split character. (See the discussion of OBS=.)
Featured in:Customizing Text in Column Headings

Note:   PROC PRINT does not split labels of BY variables in the heading preceding each BY group even if you specify SPLIT=. Instead, PROC PRINT replaces the split character with a blank.   [cautionend]

View solution in original post

4 REPLIES 4
ballardw
Super User

Where to expect to see the linebreak take effect? SAS output such as proc contents, the explorer window or elsewhere?

Tom
Super User Tom
Super User

That is what the SPLIT= option on PROC PRINT is designed for. 

SPLIT='split-character'

specifies the split character, which controls line breaks in column headings. It also uses labels as column headings. PROC PRINT breaks a column heading when it reaches the split character and continues the header on the next line. The split character is not part of the column heading although each occurrence of the split character counts toward the 256-character maximum for a label.

Alias:S=
Interaction:You do not need to use both LABEL and SPLIT= because SPLIT= implies the use of labels.
Interaction:The OBS= option honors the split character. (See the discussion of OBS=.)
Featured in:Customizing Text in Column Headings

Note:   PROC PRINT does not split labels of BY variables in the heading preceding each BY group even if you specify SPLIT=. Instead, PROC PRINT replaces the split character with a blank.   [cautionend]

metallon
Pyrite | Level 9

Awesome! Thats what I needed!

Peter_L
Quartz | Level 8

Another possibility, which is useful only if you are sending ODS output to HTML, is to add a soft hyphen character. This causes the browser dynamically to break the word at the hyphen if the available space is narrow, in the same way as it does with a space.

Example:

%let HY=^{unicode 00AD};
SQL fragment: Quality label="Qual&HY.ity",

Notice the dot to end the macro variable reference.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 10340 views
  • 4 likes
  • 4 in conversation