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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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