0

Problem statement: SAS code to Identify records from the input having a difference of >31 days and delete the current and previous record - Example Agent5 both records should be removed has they have 58 days difference Please share your inputs. appreciate for any help and guidance. thank you

Input

AgentNo date      status  
Agent1  20230320  Appointed
Agent1  20230322  Terminated
Agent2  20230331  Terminated
Agent2  20230510  Appointed
Agent2  20230511  Terminated
Agent3  20230421  Terminated
Agent3  20230421  Appointed
Agent4  20230105  Terminated
Agent4  20230305  Appointed
Agent4  20230505  Terminated
Agent5  20230310  Appointed
Agent5  20230512  Terminated

Output

AgentNo date      status  
Agent1  20230320  Appointed
Agent1  20230322  Terminated
Agent2  20230331  Terminated
Agent2  20230510  Appointed
Agent2  20230511  Terminated
Agent3  20230421  Terminated
Agent3  20230421  Appointed
Agent4  20230105  Terminated
Agent4  20230305  Appointed
Agent4  20230505  Terminated
toyota Supra
  • 3,181
  • 4
  • 15
  • 19
Ravi
  • 1
  • Have you tried the INTCK function https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p1md4mx2crzfaqn14va8kt7qvfhr.htm – Rud Faden Aug 09 '23 at 08:32

0 Answers0