BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cynthia_sas
SAS Super FREQ

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
SAS Super FREQ
Hi:
Yes, REPORT and TABULATE have different inheritance rules.
Cynthia

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 17 replies
  • 990 views
  • 16 likes
  • 4 in conversation