BookmarkSubscribeRSS Feed
septemberbulb
Obsidian | Level 7

 

Application number

O_DATENumberAPPSTATUSDATEAPPLICATION_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.

2 REPLIES 2
art297
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, AnalystFinder.com

ballardw
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: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... 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.

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 673 views
  • 0 likes
  • 3 in conversation