Article
· Mar 23, 2023 1m read

Getting the list of routines programmatically

InterSystems FAQ rubric

You can programmatically retrieve routine dates and sizes using the RoutineList query of the %Library.Routine (or just %Routine) class.

The RoutineList query has an argument, and the routine name to be searched can be specified by prefix match or middle match. (For wildcards, specify * or ?)

In the example below, *.MAC is specified as an argument.

 SET tStatement =  ##class(%SQL.Statement).%New()
 DO tStatement.%PrepareClassQuery("%Routine" , "RoutineList") 
 SET rs = tStatement.%Execute("*.MAC",,0) 
 DO rs.%Display() 

In addition to the routine list, you can also get the class definition list.

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