BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12


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;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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;

View solution in original post

8 REPLIES 8
ballardw
Super User

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;
DavidPhillips2
Rhodochrosite | Level 12

Ballardw,

Thanks that worked great.

DavidPhillips2
Rhodochrosite | Level 12

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;

ballardw
Super User

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;
ballardw
Super User

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.

DavidPhillips2
Rhodochrosite | Level 12

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;

ballardw
Super User

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?

DavidPhillips2
Rhodochrosite | Level 12

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.


a.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 8 replies
  • 1939 views
  • 1 like
  • 2 in conversation