I believe that date comparisons must be in the form of
IF DATE = '01JAN2012'd
and not
IF DATE = '01/01/2012'd
regardless of the format used for the variable.
If they are all formatted as dates it won't matter:
DATA have;
infile cards dsd;
informat date mmddyy10.;
format date mmddyy10.;
INPUT date;
cards;
01/01/2012
;
data want;
set have;
date2 = date;
date3 = date;
format date2 date9. date3 yymmdd8.;
if date = date2 = date3 then match = 'yes';
run;
if you have dates coming in as numeric or character formats you might want to change that. If that doesn't help give an example of the data you have and what you are trying to do.
Mark
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.