BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tanya_henderson
Obsidian | Level 7
VisitDemographics DateTele-visit
Orientation
Date
Visit Status Date
SC08JAN201908JAN201910JAN2019

 

I have data like the column above and I wanted to know if there was a simple way to highlight the column where the date does not match the others?

 

I am comparing several columns to ensure data entry compliance and I wondered if there was a simple way to highlight the columns that were the "outliers" from the others. 

 

The issue is that I don't have one column that is the "gold standard". I am simply comparing them all and exporting the record if they do not all match. I would like to enhance the report by highlighting the exceptions, if possible. 

 

This is my data step (sample):

 

if event_id = 'SC' then do;
if demo_dttm = screenorientdttm
AND screenorientdttm = visstatdttm
then output h_date_compare;
else output SC;
end;

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
ballardw
Super User

You mention Proc Report in your subject line.

 

Where is the Proc Report code? Data step can prepare things for the report but you don't show anything from proc report.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

You might find it hand to do the actual tests for equality in the data step and set one or more flag variables and use those to highlight cells.

tanya_henderson
Obsidian | Level 7

Currently, I am not doing any comparisons in the proc report, just simply displaying the data. 

 


ods tagsets.ExcelXP file="&sasinfile..xml" style=Printer;
ods tagsets.ExcelXP options(sheet_name= 'Screening'
autofit_height='yes'
autofilter='yes'
absolute_column_width = '20,10,10,10,10');
ods tagsets.ExcelXP ;

proc report data = SC split='?';
columns guid event_id demo_dttm screenorientdttm visstatdttm /*invsigdttm*/ ;

define guid / display 'GUID';
define event_id/ display 'Visit';
define demo_dttm /display 'Demographics Date';
define screenorientdttm /display 'Tele-visit?Orientation?Date';
define visstatdttm /display 'Visit Status Date';
define invsigdttm /display 'Inv Sign Date';

run;

hashman
Ammonite | Level 13

@tanya_henderson:

You can use the COMPUTE block to do this. See, for example:

 

https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/224-2008.pdf

 

Kind regards

Paul D. 

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
  • 3 replies
  • 729 views
  • 1 like
  • 3 in conversation