Visit | Demographics Date | Tele-visit Orientation Date | Visit Status Date |
SC | 08JAN2019 | 08JAN2019 | 10JAN2019 |
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;
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.
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.
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;
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.