BookmarkSubscribeRSS Feed
yonib
SAS Employee
Hi,
I made this code:

ods html file= "xxxx.html"
proc report data=temp nowindows noheader headskip nowd missing ;
column pt txt;
define pt /order left ;
define txt /group width=150 ;
compute after txt;
line ' ';
endcomp;
compute after pt;
line ' ';
endcomp;
compute before ;
line @50 'Repeat Error';
line '';
endcomp;
run;
ods html close;

Im trying to foreground the 'Repeat Error' with red color without succes....
I tried to use call defined after the compute before statment-its not working.

Any ideas?

Thanks in advanced
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
The style override for a line statement can be supplied in one of two ways:
[pre]
proc report data=temp nowindows noheader nowd missing
style(lines)={foreground=red};
[/pre]

OR
[pre]
compute before / style={foreground=red} ;
line 'Repeat Error';
line ' ';
endcomp;
[/pre]

Also note that your HEADSKIP and WIDTH= options are not honored by ODS -- they are LISTING-destination only options. So, if you were hoping to get extra space after your headers or control the width of the TXT column -- you cannot use LISTING only options for the HTML destination. Also the "@50" in the LINE statement will have little impact on your text string, since in ODS HTML output. the LINE strings will be automatically centered.

Also, if the LISTING destination is open when you run this job, you might receive an error message such as this:
[pre]
ERROR: The width of txt is not between 1 and 96. Adjust the column width or line size.
[/pre]

...which is the result of having the LISTING destination open and setting the width of TXT to be 150. The way to get rid of this error message is to explicitly close the LISTING window:
[pre]
ods listing close;
[/pre]

cynthia
yonib
SAS Employee
Hi cynthia,
Thanks alot for your help.
The reason i have listing options is because im also the using ods listing option
(i didnt show it in the code beacuse it wasnt relevent to my question).

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 2 replies
  • 3385 views
  • 0 likes
  • 2 in conversation