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
SAS Super FREQ
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2726 views
  • 0 likes
  • 2 in conversation