BookmarkSubscribeRSS Feed
Obsidian | Level 7


Application number

1585704May2016 0:00:00158576612823Apr201615857
3234402Nov2015 0:00:00323443949331Oct201532344
6127507Jan2016 0:00:00612752254230Dec201561275
6137804Dec2015 0:00:00613784842227Nov201561378


Hello ,


I am trying to using proc sql a left join to make the Application_num=Num where month(datepart( t1.O_DATE)= month(t2. APPSTATUSDATE) and year\(datepart( t1.O_DATE)= \(t2. APPSTATUSDATE) 


But the rows in the excel above coule not match because they are not in the same month, how can I include them in my filter ?


Thank you.

Opal | Level 21

I, for one, don't understand what you just said. Without expressing it in code criteria are you trying to incorporate to consider one record matching with another?


Art, CEO,

Super User

If I understand you want to do something you have defined when the month and year match between your two variables O_date and AppStatusDate. But then you show values for those variables where the month and year do not match.


Can you provide and actual rule for how that match is supposed to take place?


Also, since you are apparently using TWO data sets then the structure of those sets is important. For instance which sets to the variables "Application number" (not a valid SAS name generally) and Number come from?

It would be best to post 1) all of the code not that pseudocode with illegal syntax, 2) examples of records from each data set. Do not paste pictures or Excel copy & paste. Data should be in form of a data step so that we can actually recreate useable data. Anything pasted from Excel requires us to guess about the actual variable type and name.


Instructions here: will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3 in conversation