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

Hi,

 

Why call define works with display variables but not with analysis variables ?

 

proc report data=sashelp.class;
    column name--height;
    define name   / display;
    define sex    / display;
    define age    / display;
    *define age   / analysis mean;
    define height / analysis mean;
    
    compute age;
       if age=12 then call define(_row_,'style','style=[background=lightpink]');
    endcomp;
    
    rbreak after / summarize;
run;

 

When age is used as display the row where age=12 will be in lightpink, but by definition, the mean won't be available.

 

If we change age to analysis mean, the mean will be calculated but the rows won't be in lightpinkt.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
If you are using
define age / analysis mean;

Try :
compute age;
if age.mean=12 then call define(_row_,'style','style=[background=lightpink]');
endcomp;

View solution in original post

1 REPLY 1
Ksharp
Super User
If you are using
define age / analysis mean;

Try :
compute age;
if age.mean=12 then call define(_row_,'style','style=[background=lightpink]');
endcomp;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 668 views
  • 1 like
  • 2 in conversation