DATA Step, Macro, Functions and more

Proc report -Help

Reply
Frequent Contributor
Posts: 97

Proc report -Help

Hello

I want to  add background lightgrey color to  only to 2 rows:

Total    .   66    20

and 

a1   Total    60  30

 

I want also that two titles "groupCategory"    and "Information"  will in red color

 

 

I want  also that column z1 will be bold

Can anyone help please?

 

 

 

 

Data tbl;
Input Z1 $ Z2 $ X Y;
Cards;
a1 b1 10 5
a1 b2 20 10
a1 b3 30 15
a1 Total 60 30
a2 b1 1 2
a2 b2 2 4
a3 b3 3 6
a3 Total 6 8
Total . 66 20
;
Run;

PROC REPORT DATA=tbl nowd SPANROWS
style(header)={background=white};
Column ("groupCategory" z1 z2 )
("Information" X Y );
DEFINE z1 /Display 'Department' style(header)={background=lightblue};
DEFINE z2 /Display 'Team' style(header)={background=lightblue};
DEFINE x /Display "לקוחות" style(header)={background=lightblue};
DEFINE y /Display "אובליגו " style(header)={background=lightblue};
Run;

Super User
Super User
Posts: 9,427

Re: Proc report -Help

For the groupcategory and information you would likely need to use inline styles, this is escape character styles, something like:

ods escapechar="^";
...
proc report...
  column ("^s={background=red}groupCategory" z1 z2)...;
...
run;

For the total you would use a compute/endomp block and call define the right style, here is a paper on it with examples:

https://support.sas.com/resources/papers/stylesinprocs.pdf

Ask a Question
Discussion stats
  • 1 reply
  • 54 views
  • 0 likes
  • 2 in conversation