Question Anthony Ennis · Jan 3, 2024

Is there a CLI tool that will allow me to examine the routines in the database?

I need to verify that certain .m files have been compiled and inserted into the VA mumps database.  I need to do it on a schedule and thus I want to automate it.  Because of the automation I'd prefer not to use the IRIS web app. So if there were a similar CLI version that would be great. I see there is something called /usr/bin/iris but this seems to be a maintenance tool, not a IRIS.DAT querying tool.  I'd love to be wrong about that.

Please forgive my lack of proper nomenclature, clearly I'm a n00b.

Product version: IRIS 2023.3

Comments

Robert Cemper · Jan 3, 2024

#1)  what type of "routine" do you try to handle ?

  • .cls
  • .mac
  • .int
  • .obj

#2) what is the Format you get those "routines"

  • .ro
  • .xml
  • .udl

some combinations may allow  "command line" examination 

0
Anthony Ennis  Jan 3, 2024 to Robert Cemper

I suppose .int. At this time, I am looking for the presence of the routine though who knows what tomorrow brings.  XML or Json would be good for the output.

0
Anthony Ennis · Jan 3, 2024

It looks like /usr/bin/irisdb is just the thing... Legend has it that this is the old "cache" command.

0
Mario Sanchez Macias · Jan 8, 2024

I am not sure what you need or are looking for. If you want to list all the routines, you can do it by looping on the ^ROUTINE global. There are some other methods using System libraries to get this information. 

As a quick example, you can copy-paste the following code directly into the terminal to see if this is what you need: 

// In one line: SET routineName=""FORSET routineName=$ORDER(^ROUTINE(routineName)) QUIT:routineName=""WRITE routineName, !

// More readable: SET routineName = ""FOR {
    SET routineName = $ORDER(^ROUTINE(routineName))
    QUIT:routineName=""WRITE routineName, !
}
0
Clayton Lewis · Jan 8, 2024

You need to look at timestamps in 2 globals:

^ROUTINE contains the source code of the routine.

^ROUTINE(RoutineName,0) = Timestamp when the routine was last saved.  ($ZTS format, local timezone).

^rOBJ contains the compiled object code.  This will not exist if the routine has never been compiled.

^rOBJ(RoutineName,"INT") = Timestamp when the INT routine was last compiled.

If the date in ^ROUTINE is later than in ^rOBJ, the compiled code may be out of synch with the source.  This isn't guaranteed though, since the last save doesn't necessarily reflect a code change that would require recompile.

For MAC routines you'll want to look at:

^rOBJ(RoutineName,"MAC") = Timestamp when MAC routine was last compiled

^rMAC(RoutineName,0) = Timestamp when MAC routine was last saved

For Classes I believe you want TimeChanged from %Dictionary.CompiledClass.  You can get that using SQL:

select TimeChanged from %Dictionary.CompiledClass where ID = FullyQualifiedClassName

0
Anthony Ennis · Jan 11, 2024

Thank you all for the information, it is very helpful!

0