Desktop productivity for business analysts and programmers

SAS Data Set LABEL and linebreak

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 133
Accepted Solution

SAS Data Set LABEL and linebreak

Hi,

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

Thanks


Accepted Solutions
Solution
‎01-29-2015 11:04 PM
Super User
Super User
Posts: 6,323

Re: SAS Data Set LABEL and linebreak

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


All Replies
Grand Advisor
Posts: 10,210

Re: SAS Data Set LABEL and linebreak

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

Solution
‎01-29-2015 11:04 PM
Super User
Super User
Posts: 6,323

Re: SAS Data Set LABEL and linebreak

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]

Frequent Contributor
Posts: 133

Re: SAS Data Set LABEL and linebreak

Awesome! Thats what I needed!

Contributor
Posts: 32

Re: SAS Data Set LABEL and linebreak

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.

☑ This topic is SOLVED.

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

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