Question
· Feb 1

keep only the COS routine object (cache object script) to preserve the source routine.mac

Import from DC-PT, @EDILSON CARVALHO 

We have some *.mac routines and we need to preserve their source,
as these routines have intellectual authorship and can only be used per session
with the right to use (they cannot be viewed or edited).
The question: how to keep only the routine object in the IRIS namespace,
without interfering with its execution?

Discussion (2)2
Log in or sign up to continue

Try this from %Library.Routine: 
https://docs.intersystems.com/iris20243/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=%25Library.Routine#Delete
with flag=2

classmethod Delete(rtnname As %String, flag As %String = 0, supressbackup As %Boolean = 0, nsp As %String = $namespace) as %Status

Delete the routine rtnname. If the rtnname is not fully qualified we will resolve this into a fully qualified name first and then proceed with the rest of the delete. For example if you specify 'test' and there is a 'test.mac' it will resolve to this, if there was only a 'test.obj' it will resolve the name to this. The parameter flag specifies how much to delete. The options are:

  • 0 - Delete entire routine, for a MAC routine this will delete MAC, INT, OBJ. For an INT routine it will delete INT and OBJ, for a INC routine it will only delete the INC, for a BAS routine it will delete the BAS and the OBJ code.
  • 1 - Delete just the named routine, for example for a MAC routine it will only delete the MAC and it will leave the INT and OBJ if present.
  • 2 - Delete all the source code but leave any OBJ code.