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

Hi: PROC TABULATE basically replaces one set of attributes with the other in the event of conflicts between the row and the column style overrides. Typically, with TABULATE, you have to re-specify ALL the attributes you want to have in effect because TABULATE doesn't do inheritance the way you want. It is possible to get what you want with both REPORT and TABULATE, as shown below:

Cynthia_sas_0-1624031236521.png

 

 

It's a bit more complicated using REPORT because AGE is numeric and you need to create a computed item to get a text string such as Total on the summary line. But the same results are do-able with either REPORT or TABULATE.


Cynthia

ChrisNZ
Tourmaline | Level 20

Hi Cynthia,

Proc report allows merging styles (style/merge might be the default option?) while proc tabulate does not.

That's what I wanted to check.

proc report allows me to simply make a column with an attribute, a row with another and the crossing with both.

proc report data=SASHELP.CLASS;
  columns AGE WEIGHT HEIGHT ;
  define AGE      / group ;
  define  WEIGHT  / analysis;
  define  HEIGHT  / analysis style=[font_weight=bold];
  rbreak after    / summarize;
  compute after;
    call define(_row_,'style','style=[color=green]');
  endcomp;
run ;

There's no way with proc tabulate to have one row in green thin, one col in bold, and only one cell on green bold it seems.

Thank you for refreshing my memory about header and parent inheritance, and about precedence. 🙂

 

 

 

 

 

Cynthia_sas
Diamond | Level 26
Hi:
Yes, REPORT and TABULATE have different inheritance rules.
Cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 2808 views
  • 16 likes
  • 4 in conversation