BookmarkSubscribeRSS Feed
amiller
Fluorite | Level 6

Hello, 

I have data that may have changed from the last run of a report. I am bringing in the old report and merging with the new run. If a datapoint changes, I would like to use proc report to add a flyover comment in the excel cell to show the previous value. I am using SAS 9.4, ODS tagsets excelxp. I know how to add the flyover comment  like this:

 

compute mhstdat_raw;
* Cell comment;
if mhstdat_raw="09 Feb 2022" then call define(_col_, "style", "style=[background=yellow flyover='Value has changed']");
endcomp;

 

But, I have a lot of datapoints and the flyover needs to show the previous value which I have in the dataset. On the subject's record, I have the data variable that changed in a variable called VARIABLE and the previous value in a variable called VAL. I was hoping I could do something like this:

 

compute mhstdat_raw;
* Cell comment;
if variable="mhstdat_raw" then call define(_col_, "style", "style=[background=yellow flyover=val]");
endcomp;

 

I want to add the comment in the MHSTDAT_RAW cell with the value of VAL, but this does not work.

 

Any suggestions?

Thanks!

2 REPLIES 2
Tom
Super User Tom
Super User

You probably will want to create a boolean variable to indicate whether or not the value has changed in a step before you call PROC REPORT to produce your pretty Excel file.

 

Can you show a small working example of what you are trying to do?  Just enough data to demonstrate the issue.

amiller
Fluorite | Level 6

I think I have figured this out.

 

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