BookmarkSubscribeRSS Feed
tejeshwar
Calcite | Level 5
I am running the below code and facing couple of issues.
You will notice that executing the output of 3 datasets in a single email through proc report. However the problem is my objective is to have the header only on the fisrst one, but for me to be able to do that I have to give the option of title " " in the other 2 reports or else the output picks up the title from the first proc report.

When i do that now, the title is blank but there is still a grey box which i really dont want

The second issue there are some numbers that are -ve in the output. I need them in a format that represents -3 as (3). Could you suggest me a format to accomplish that.

Below is the code


*rsubmit;
filename OUTBOX1 email
to=("XYZ@ab.com"
)



type='text/html' subject=" Daily Acquisition " ;
ods listing close ;
ods html body = OUTBOX1 style=sasweb;


option nocenter ;
proc report nowd data=Dc nowindows headline headskip split='*'
style(REPORT)={frame=box cellspacing=1 }
style(HEADER)={background=#cccfff font_face=Tahoma font_size=1}
style(COLUMN)={foreground=#000000 background=white font_face=Tahoma font_size=1}
style(LINES)={foreground=white background=black font_face=Tahoma font_weight=bold font_size=1};
column type apps1 acts per ;
title "Daily Acquisition 29MAR2010";
define apps1 / '# Apps' format=comma16. center display;
define acts/ '# Accts' format=comma16. center display;
define per/ '% Appr' format=percent16.1 center display;
compute apps1 ;
if apps1 lt 0 then
call define(_col_,'style','style=[foreground=red]');
else
call define(_col_,'style','style=[foreground=black]');
endcomp;
compute acts;
if acts lt 0 then
call define(_col_,'style','style=[foreground=red]');
else
call define(_col_,'style','style=[foreground=black]');
endcomp ;
rbreak after / style= sasweb;


proc report nowd data=ba nowindows headline headskip split='*'
style(REPORT)={frame=box cellspacing=1 }
style(HEADER)={background=#cccfff font_face=Tahoma font_size=1}
style(COLUMN)={foreground=#000000 background=white font_face=Tahoma font_size=1}
style(LINES)={foreground=white background=black font_face=Tahoma font_weight=bold font_size=1};
column type apps1 acts per ;
title " ";
define apps1 / '# Apps' format=comma16. center display;
define acts/ '# Accts' format=comma16. center display;
define per/ '% Appr' format=percent16.1 center display;
compute apps1 ;
if apps1 lt 0 then
call define(_col_,'style','style=[foreground=red]');
else
call define(_col_,'style','style=[foreground=black]');
endcomp;
compute acts;
if acts lt 0 then
call define(_col_,'style','style=[foreground=red]');
else
call define(_col_,'style','style=[foreground=black]');
endcomp ;

proc report nowd data=PLC nowindows headline headskip split='*'
style(REPORT)={frame=box cellspacing=1 }
style(HEADER)={background=#cccfff font_face=Tahoma font_size=1}
style(COLUMN)={foreground=#000000 background=white font_face=Tahoma font_size=1}
style(LINES)={foreground=white background=black font_face=Tahoma font_weight=bold font_size=1};

column type apps1 acts per ;
title " ";
define apps1 / '# Apps' format=comma16. center display;
define acts/ '# Accts' format=comma16. center display;
define per/ '% Appr' format=percent16.1 center display;
compute apps1 ;
if apps1 lt 0 then
call define(_col_,'style','style=[foreground=red]');
else
call define(_col_,'style','style=[foreground=black]');
endcomp;
compute acts;
if acts lt 0 then
call define(_col_,'style','style=[foreground=red]');
else
call define(_col_,'style','style=[foreground=black]');
endcomp ;

footnote "*XXXXX is included in the numbers ";
run;
ods html close;
ods listing;
2 REPLIES 2
Tim_SAS
Barite | Level 11
Try using just

[pre]title;[/pre]
to turn off the titles
(http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000220968.htm ).

To format -3 as (3), use the NEGPARENw.d format
(http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000205173.htm ).
tejeshwar
Calcite | Level 5
Thanks Tim.
This worked perfectly fine.

I am troubling you with one more question.
There is a line break between the 3 grids that are being created here and the space between the grid and the line break is quite a bit.

Is there a way to reduce that?

Again, thanks for your help

Regards,
Tej Message was edited by: tejeshwar

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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