Discussion (7)3
Log in or sign up to continue

Good afternoon Pietro,

Try %RO. It's "Routine Out". Enter at the command line "D ^%RO" and just follow the prompts. This is a systems routine that's been a staple of Intersystems since forever and was there in 2021. Good luck. PLEASE IGNORE THE PREVIOUS PART OF MY POST - I misunderstood what you wanted to do. I thought you wanted one single file for all the routines, not individual files for each routine. %RO will let you do individual files for each routine but you'll have to specify each individual routine and the file it should be written to. It will work for MAC and INT files but I'm not sure about anything else. It seems to me that some of the other solutions proposed by others will do what you want. However, it all you want are MAC routines and INT routines you could write a small quick and dirty routine to do that. 

Hello @Pietro Montorfano 

You can try to write your own export method.
Using %Library.RoutineIndex looks good.  Example to export all ".MAC" :

set tRes = ##class(%SQL.Statement).%ExecDirect(.tStmt,"select name||'.'||type as itemName  from %Library.RoutineIndex where type = ? and $Extract(name,1) <> '%'","MAC")
While tRes.%Next() {
	Do $SYSTEM.OBJ.ExportUDL(tRes.%Get("itemName"),"<dir>/"_tRes.%Get("itemName"))
}