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).

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3264 views
  • 0 likes
  • 2 in conversation