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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.