I am trying to add the commented line and running into syntax errors. How do I color a tabular header like a proc report header? This is the same line that I use successfully in proc report.
title 'Fall 2015 UG Engineering Admissions Status (enrolled)';
proc tabulate data= eaar.summary_opds_stu_admissions /*style(header)=[background=#969491 color=white]*/ out= Fall_UG_Admission_Status ;
class application_type;
var enrolled;
table ( application_type= ' ' all) * N = ' ';
where college = 'EG' and academic_period_desc = 'Fall 2015' and
application_level = 'Undergraduate' and enrolled = 1;
run;
Tabulate takes a bit more work and you need to address things a bit differently. See if this come close
title 'Fall 2015 UG Engineering Admissions Status (enrolled)';
proc tabulate data= eaar.summary_opds_stu_admissions out= Fall_UG_Admission_Status ;
class application_type /style=[background=#969491 color=white];
classlev application_type /style=[background=#969491 color=white];
keyword all /style=[background=#969491 color=white];
var enrolled;
table ( application_type= ' ' all) * N = ' ';
where college = 'EG' and academic_period_desc = 'Fall 2015' and
application_level = 'Undergraduate' and enrolled = 1;
run;
Tabulate takes a bit more work and you need to address things a bit differently. See if this come close
title 'Fall 2015 UG Engineering Admissions Status (enrolled)';
proc tabulate data= eaar.summary_opds_stu_admissions out= Fall_UG_Admission_Status ;
class application_type /style=[background=#969491 color=white];
classlev application_type /style=[background=#969491 color=white];
keyword all /style=[background=#969491 color=white];
var enrolled;
table ( application_type= ' ' all) * N = ' ';
where college = 'EG' and academic_period_desc = 'Fall 2015' and
application_level = 'Undergraduate' and enrolled = 1;
run;
Ballardw,
Thanks that worked great.
In this case how do I color the cell in the top left?
proc tabulate data= mytable;
class student_classification1 department degree_level / style=[background=#969491 color=white];
classlev student_classification1 department degree_level / style=[background=#969491 color=white];
keyword all / style=[background=#969491 color=white];
var students_enrolled;
table department = ' ' all, (degree_level=' ' * student_classification1= ' ' all) * N = ' ';
run;
Are you referring to the often empty box in the upper left that is addressed using BOX in the table options? BOX allows style options as well so something like:
proc tabulate data= mytable;
class student_classification1 department degree_level / style=[background=#969491 color=white];
classlev student_classification1 department degree_level / style=[background=#969491 color=white];
keyword all / style=[background=#969491 color=white];
var students_enrolled;
table department = ' ' all,
(degree_level=' ' * student_classification1= ' ' all) * N = ' '
/box = [style=[background=#969491 color=white]]
;
run;
If you are going to want to use the same appearnce often I would be very tempted create a custom ODS style. Many of the SAS developed styles such as Analysis, Meadow, Festival and others will have the column and row header area appear with different color background if not text foreground. Use one of those close to your other appearance needs and use in as the basis for your report output.
On the subject of formatting is there a keyword that removes blank values form the header section? I’m blanking out the space for values like N but the space remains.
For example:
title 'Fall 2015 UG Engineering Admissions Status (enrolled)';
proc tabulate data= mytable style =[font_size=1] out= Fall_UG_Admission_Status missing;
class application_type / style=[background=#969491 color=white font_size=1];
classlev application_type / style=[background=#969491 color=white font_size=1];
var enrolled / style =[font_size=1];
table ( application_type= ' ' * all= ' ') * N = ' ' / row=float;
run;
You'll either need to provide some example data to run the code against to see what your output is or provide a picture.
I'm not sure which potential blanks you may be referring to.
Since your code doesn't have a row dimension I'm not sure what the affect of row=float might be.
I note that you are now show
application_type= ' ' * all= ' '
where previously you had
application_type= ' ' all= '
Did you intend to nest the all within levels of application_type?
The output shown is what I am aiming for but the blanks make it weird. I’m trying to remove the blanks from the top box. I attached a screenshot.
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!
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.