HI..
I have a limited knowledge of SAS. I am an AS400 developer who recently jumped to this platform when my company offered me the opportunity.
I am using EG (7.1) and trying to do a left join on 2 tables using a date field.
Table1 has a format of 20OCT2016:00:00:00
Table2 has a format of 20OCT2016
EG wants me to a manual join.. since there is no natural matching columns between the two tables.
I can connect the 2 date columns together and run it without errors, but my results show as NULL values. so the match didnt work
Can I extract(substring) the date only from table1 and do this?
Regards,
Chris
Most likely, what you are seeing are formatted versions of the data values (not the actual values).
If that's the case, the issue is that one table contains a date-time combination but the other is just the date. Try matching this way:
datepart(table1.fieldname) = table2.fieldname
It's the most likely way to resolve this, but sometimes it takes inspecting the data more closely.
Most likely, what you are seeing are formatted versions of the data values (not the actual values).
If that's the case, the issue is that one table contains a date-time combination but the other is just the date. Try matching this way:
datepart(table1.fieldname) = table2.fieldname
It's the most likely way to resolve this, but sometimes it takes inspecting the data more closely.
Thanks for the help, that worked great!
As I start doing more programming, I'm sure I'll be posting out here quite a bit with questions.
-Chris N.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.