BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
davehalltwp
Quartz | Level 8

I'm not sure actually if this is a SAS question, or a character set question, but with all the geniuses around here, I'll probably get an answer anyway.

 

I am trying to print a page header in proc report.  I would like a line below it, but without skipping a line (overprint?)  

 

ie

 

PAGE HEADER

_____________________________

 

Where the line prints without a line feed.

 

It's within a PROC REPORT COMPUTE BEFORE _PAGE_ block.

 

I wonder if it's a matter of embedding control characters such as "~line " (I can't remember the syntax) in the text string.  I haven't done much of that.

 

Right now I have:

 

compute before _PAGE_;

         line @1 subgtext $ 30. ;
          line @1 131 * '_';

endcomp;

that prints two separate lines, of course.

 

Thank you...

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
proc sort data=sashelp.class out=class;
by sex;
run;

ods rtf file='c:\temp\temp.rtf';
options nobyline;
proc report data=class nowd;
by sex;
columns name age weight height;
compute before _PAGE_/style={textdecoration=underline};
subgtext='XXXXXXXXXXX';
line @1 subgtext $30. ;
endcomp;
run;
ods rtf close;

Ksharp_0-1682596123843.png

 

View solution in original post

3 REPLIES 3
ballardw
Super User

Best would be to include some example data in the form of data step code and the completer Proc Report code so we can test possible solutions.

 

Also, which ODS destination are you using. Some solutions may be destination dependent. For example, if you were using the ODS LISTING destination that either the UL or DUL options would apply. But these, derived from the days of line printers, only work in the LISTING destination. Also the ODS Style that is in effect.

Ksharp
Super User
proc sort data=sashelp.class out=class;
by sex;
run;

ods rtf file='c:\temp\temp.rtf';
options nobyline;
proc report data=class nowd;
by sex;
columns name age weight height;
compute before _PAGE_/style={textdecoration=underline};
subgtext='XXXXXXXXXXX';
line @1 subgtext $30. ;
endcomp;
run;
ods rtf close;

Ksharp_0-1682596123843.png

 

davehalltwp
Quartz | Level 8

Thank you, KSharp.  That worked perfectly!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 983 views
  • 2 likes
  • 3 in conversation