Help using Base SAS procedures

question about time variable selection

Reply
Contributor
Posts: 28

question about time variable selection

 

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.

PROC Star
Posts: 7,363

Re: question about time variable selection

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

Super User
Posts: 10,500

Re: question about time variable selection

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.

Ask a Question
Discussion stats
  • 2 replies
  • 102 views
  • 0 likes
  • 3 in conversation