Help using Base SAS procedures

proc report (* in .lst output)

Reply
SAS Employee
Posts: 73

proc report (* in .lst output)

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
********
Respected Advisor
Posts: 3,799

Re: proc report (* in .lst output)

Posted in reply to Pavan_SAS
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]
SAS Employee
Posts: 73

Re: proc report (* in .lst output)

Posted in reply to data_null__
why '2A2AA0'x only?
any special reason or we can use any characters with in the quotes?
Respected Advisor
Posts: 3,799

Re: proc report (* in .lst output)

Posted in reply to Pavan_SAS
2A is asterisks
A0 is a character that usually looks like a blank
SAS Employee
Posts: 73

Re: proc report (* in .lst output)

Posted in reply to data_null__
but i am not getting expected output. i am using sas8.2
help me to get the proper result.
Respected Advisor
Posts: 3,799

Re: proc report (* in .lst output)

Posted in reply to Pavan_SAS
I'm using v9.1.3

See if this works.


[pre]define a / "aaa#" "**%sysfunc(byte(160))";[/pre]
SAS Employee
Posts: 73

Re: proc report (* in .lst output)

Posted in reply to data_null__
thanks a ton. its working !!!
here why 160? reason?
SAS Employee
Posts: 73

Re: proc report (* in .lst output)

Posted in reply to Pavan_SAS
The ASCII equivalent of 160 is single space.
Respected Advisor
Posts: 3,799

Re: proc report (* in .lst output)

Posted in reply to Pavan_SAS
non-breaking space
SAS Employee
Posts: 73

Re: proc report (* in .lst output)

Posted in reply to data_null__
sorry!
i am getting following output, if i use your code (define a / "aaa#" '2A2AA0'x Smiley Wink:

aaa
2A2AA0'
Ask a Question
Discussion stats
  • 9 replies
  • 246 views
  • 0 likes
  • 2 in conversation