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

Dear All,

 

I am looking for the solution to display "++" "--" in the column header as mentioned in the define statement.

 

E.g. Define xyz/ "++";

        Define abc/ "--";

 

But the output displayed are "++++++" "-------" respectively which is not my expectation.

 

Please let me know if you have any solution

 

Thanks

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @Pankp,

 

Just an ad-hoc idea: Add an invisible character to the string, e.g. 'A0'x (non-breaking space).

 

Example:

proc report data=sashelp.class(obs=3);
column name height;
define name / '2B2BA0'x; /* "++" left-aligned */
define height / 'A02D2D'x; /* "--" right-aligned */
run;

(2B and 2D are the hexadecimal ASCII codes of "+" and "-", respectively.)

 

Result:

++               --
Alfred           69
Alice          56.5
Barbara        65.3

 

 

View solution in original post

3 REPLIES 3
data_null__
Jade | Level 19

RTM

 

In LISTING output, if the first and last characters of a heading are one of the following characters, then PROC REPORT uses that character to expand the heading to fill the space over the column or columns. Note that the <>and the >< must be paired. − = . _ * +<> ><

Similarly, if the first character of a heading is < and the last character is >, or vice versa, then PROC REPORT expands the heading to fill the space over the column by repeating the first character before the text of the heading and the last character after it.

FreelanceReinh
Jade | Level 19

Hello @Pankp,

 

Just an ad-hoc idea: Add an invisible character to the string, e.g. 'A0'x (non-breaking space).

 

Example:

proc report data=sashelp.class(obs=3);
column name height;
define name / '2B2BA0'x; /* "++" left-aligned */
define height / 'A02D2D'x; /* "--" right-aligned */
run;

(2B and 2D are the hexadecimal ASCII codes of "+" and "-", respectively.)

 

Result:

++               --
Alfred           69
Alice          56.5
Barbara        65.3

 

 

Pankp
Fluorite | Level 6
I tried implementing with Compute block but it didnt work as expected.Thanks a lot Reinhard, this worked for me.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 1107 views
  • 1 like
  • 3 in conversation