BookmarkSubscribeRSS Feed
Pavan_SAS
SAS Employee
data one;
input a $ b $;
cards;
aa1 bb1
aa2 bb2
aa3 bb3
;
run;

proc report data=one nowd split='#';
column a b;
define a / "aaa#**";
define b / "bbb" ;
run;

i want to see two *s only in .lst output under 'aaa', but i am getting 8 *s.

i am expecting this:
aaa
**

but getting this:
aaa
********
9 REPLIES 9
data_null__
Jade | Level 19
This is the reason the ** is expanded.

[pre]
column-header
defines the column header for the report item. Enclose each header in single or
double quotation marks. When you specify multiple column headers, PROC
REPORT uses a separate line for each one. The split character also splits a
column header over multiple lines.

In traditional (monospace) SAS 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:

:- = \_ .* +

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

This is as close as I could get to your desired result.

[pre]
define a / "aaa#" '2A2AA0'x ;
[/pre]
Pavan_SAS
SAS Employee
why '2A2AA0'x only?
any special reason or we can use any characters with in the quotes?
data_null__
Jade | Level 19
2A is asterisks
A0 is a character that usually looks like a blank
Pavan_SAS
SAS Employee
but i am not getting expected output. i am using sas8.2
help me to get the proper result.
data_null__
Jade | Level 19
I'm using v9.1.3

See if this works.


[pre]define a / "aaa#" "**%sysfunc(byte(160))";[/pre]
Pavan_SAS
SAS Employee
thanks a ton. its working !!!
here why 160? reason?
Pavan_SAS
SAS Employee
The ASCII equivalent of 160 is single space.
data_null__
Jade | Level 19
non-breaking space
Pavan_SAS
SAS Employee
sorry!
i am getting following output, if i use your code (define a / "aaa#" '2A2AA0'x ;):

aaa
2A2AA0'

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 9 replies
  • 1761 views
  • 0 likes
  • 2 in conversation