BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cnilsen
Quartz | Level 8

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 

- Chris N.
1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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.

View solution in original post

2 REPLIES 2
Astounding
PROC Star

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.

cnilsen
Quartz | Level 8

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.

 

- Chris N.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1615 views
  • 0 likes
  • 2 in conversation