You're right, i should have looked into that aswell. 
I got it to work with the Query now, since the %RCMP file was locked for me. 

 Set statement=##class(%SQL.Statement).%New()
 Set status=statement.%PrepareClassQuery("%Library.Routine","Compare")
  
 result
 SET result=##class(%Library.ProcedureContext).%New()
 
 SET result = statement.%Execute(NSP1,ROUTINE1,NSP2,ROUTINE2)
 DO result.DumpResults()
 

Thank you @Robert Cemper for the quick response,

I was hoping to avoid using the %RCMP Routine as it uses GOTO commands. 


One of our Senior Developers pointed me in the right direction. He recommended I use:

Class %Library.Routine
query Compare(Nsp1 As %String, RouName1 As %String, Nsp2 As %String, RouName2 As %String)

Selects LineNo1 As %String, Line1 As %String, LineNo2 As %String, Line2 As %String
This query provides a list of all lines that differ between two given routines.
Nsp1 and RouName1 specify the first routine.
Nsp2 and RouName2 specify the second routine.
Nsp1 and RouName2 can be either an explicit or an implied namespace.

I will try this and see if it works. If anyone has further advice feel free to add them.