Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
Compa;ring two dates in SAS
I have two dates in SAS. Both are defined as:
Num 8 DATE9. DATE9
Both dates contain 02AUG2011
What is the syntax to compare DATEA to DATEB. They are not comparing as equal.
I am trying to use this statement:
proc sql undo_policy=none;
create table C as
from filea a left join fileb b
and a.date= b.date;
8/22/2022 - Mon
what's the error you are getting?
if you had copied the code and pasted into the question, then it appears that there's a problem with your code: a.mbr_id=bmbr_id <- shouldn't it be b.mbr_id?
assuming that it is a genuine typo, then might be worthwhile looking at the actual value stored in the table...
It was a typo.
Even if I use a dat step the two dates do not compare equal and the data in both fields has the same description in a proc contents and the data in the date field is the same.
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
You are correct. The values I thought were equal actually have
18841 for the first date and 18841.4492 on the second date
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent