BookmarkSubscribeRSS Feed
djbateman
Lapis Lazuli | Level 10

Please see the attached Excel worksheet for what my final output should look like.  I have two databases (safety and clinical) that I merged together to check for inconsistencies.  For each patient, I am checking their serious adverse events (SAE) to make sure that the SOC, PT, start/stop dates, relationship, and death dates match in both databases.  I have two different types of traffic lighting that I need to do:

First, if there is an SAE that is in one database but not the other, it is noted in the SAEMISS variable, and I would like to highlight that whole row.

Second, if the SAE is in both databases, I would like to only highlight the 2 corresponding variables where there is no match.  For example, if a patient has the same SOC in both databases, but the PT name is slightly different, then I just want to highlight the two PTNAME cells for that case (and the same for any other variables that are different between databases).

I think I can highlight the rows from my first scenario by using the following code in PROC REPORT:

compute saemiss;

      if saemiss^='' then call define(_row_,"style","style={background=red}");

endcomp;

However, I am stuck on the second scenario.  I can find how to highlight when a numeric value is within a specified range, but I can find an example for character values that compare across observations.  Any ideas on if this is possible?

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  This is nearly an impossible question to comment on without more information. What is the structure of the data you are sending to PROC REPORT? What does your data look like? Seeing just the COMPUTE block doesn't really help, what is ALL the PROC REPORT code? Are you actually producing this result with SAS now, of is this your desired report? PROC REPORT writes only 1 report row at a time. So generally handles highlighting or traffic lighting only on 1 report row. When PROC REPORT is writing a report row, it has no visibility of the row that came before or the row that is coming next. So, depending on what you mean by "character values that compare across observations", it's probably not do-able with PROC REPORT.

  But you might consider working with Tech Support. You can send them all your code and all your data and ask them whether the type of highlighting you want to do is possible. You might consider "pre-processing" your data for the "across observation" comparison and then use some kind of flag on every report row to provide highlighting information.

cynthia

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
  • 1 reply
  • 944 views
  • 0 likes
  • 2 in conversation