The SAS Output Delivery System and reporting techniques

A Proc report question

Reply
Contributor
Posts: 59

A Proc report question

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;
Super Contributor
Posts: 394

Re: A Proc report question

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 ).
Contributor
Posts: 59

Re: A Proc report question

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
Ask a Question
Discussion stats
  • 2 replies
  • 162 views
  • 0 likes
  • 2 in conversation