DATA Step, Macro, Functions and more

Proc Tabulate-bottom line Color

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Proc Tabulate-bottom line Color

Hello all:

 

In a project, I need to make a table in SAS, I use these codes to achieve it, I did most of the job, unless one problem bothers me as following pictures.

 

Smiley Wink code I use:

data report;
infile datalines dlm=',';
informat rowvar finished male female;
input rowvar finished male female;
datalines;
1 ,1,20,40
1 ,1,60,40
2 ,1,40,40
3 ,1,60,20
3 ,1,40,0
3 ,1,60,20
4 ,1,30,0
5 ,1,0,20

;
run;

proc tabulate data =report style = [just=c vjust=m ];
classlev rowvar / style = [cellwidth=100];
class rowvar/ order=formatted preloadfmt;
keylabel all='Total';
var finished male/style= [background=#f6f5ef];
var finished female;

table rowvar=' ' all={S = {background = #E7E6D5}}*{S = {background = #E7E6D5 cellwidth=70}}
, finished='Respondents'*n=''*f=comma10.
mean="Gender"*(Male*{S = {background = #f6f5ef cellwidth=70}} Female)*f=10.1/ box={label="Department" s=[just=L ]} printmiss;
run;

 

Smiley Very HappyThe table I want:

Capture.PNG

 

Smiley IndifferentThe table I have:

Capture.PNG

 

 

 

 

It is almost there. However, I cannot come up with a solution to force the circle part to dark green, I can easily change it in Excel, but the situation is I need to make the report all completed by SAS.

 

Any help would be greatly appreciated.

 

Thanks,


Accepted Solutions
Solution
‎11-07-2017 08:53 AM
Super User
Posts: 2,513

Re: Proc Tabulate-bottom line Color

Posted in reply to XiaoGuaiShou

Like this?

 

 

proc tabulate data=REPORT style = [just=c vjust=m ];
  classlev rowvar    / style = [cellwidth=100];
  class rowvar       / order = formatted preloadfmt;
  keylabel all='Total';
  var FINISHED MALE  / style = [background=#f6f5ef];
  var FEMALE;
  table ROWVAR  = ' ' 
        all     = {s={background = #e7e6d5}} * {s={background = #e7e6d5 cellwidth=70}} 
      , FINISHED= 'Respondents'*n=' '*f=comma10.
        mean    = "Gender"*(MALE*{s={background=#f6f5ef cellwidth=70}} FEMALE)*f=10.1
      / box={label="Department" s=[just=L ]} printmiss style_precedence=row;
run;

 

 

Capture.PNG

View solution in original post


All Replies
Solution
‎11-07-2017 08:53 AM
Super User
Posts: 2,513

Re: Proc Tabulate-bottom line Color

Posted in reply to XiaoGuaiShou

Like this?

 

 

proc tabulate data=REPORT style = [just=c vjust=m ];
  classlev rowvar    / style = [cellwidth=100];
  class rowvar       / order = formatted preloadfmt;
  keylabel all='Total';
  var FINISHED MALE  / style = [background=#f6f5ef];
  var FEMALE;
  table ROWVAR  = ' ' 
        all     = {s={background = #e7e6d5}} * {s={background = #e7e6d5 cellwidth=70}} 
      , FINISHED= 'Respondents'*n=' '*f=comma10.
        mean    = "Gender"*(MALE*{s={background=#f6f5ef cellwidth=70}} FEMALE)*f=10.1
      / box={label="Department" s=[just=L ]} printmiss style_precedence=row;
run;

 

 

Capture.PNG

Occasional Contributor
Posts: 14

Re: Proc Tabulate-bottom line Color

You are awesome! your solution is exactly what I needSmiley LOL
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 141 views
  • 2 likes
  • 2 in conversation