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
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
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.
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.