Jolyon is an Avid Commentator
5 published comments for 2022
User bio
404 bio not found
Member since Nov 9, 2015

You don't need to change the "%" to a "_" in this instance as the cls method is being passed a string literal. This works fine:

InterSystems IRIS Version 2022.1.0.209

There's a method on the iris.gref class called "data".

set ^zJES(1)="$data = 1"
set ^zJES(2,0)="$data = 10"
set ^zJES(4) = ""
set ^zJES(4,0) = ""

The result ends up matching $data:

>>> glb = iris.gref("^zJES") 
>>> print(
>>> print([1])) 
>>> print([2]))
>>> print([3]))
>>> print([4]))

I found running help(iris) at the Python shell helpful for working this kind of stuff out.

Edit: Unlike @Robert Cemper's solution this does not return the value of the node we're testing (like the 2 parameter usage $data)

It's probably worth mentioning that this was always the limit. Prior to IRIS 2020.1 (from memory) any characters after the first 31 were just ignored, so in the above example the global would be truncated to ^Jobcosting.JobActivityGroupGrou. There is now a hard stop in the class compiler that prevents global names longer than the limit as there was the potential for truncated global names to clash.

Jolyon has not followed anybody yet.
Global Masters badges:
Jolyon has no Global Masters badges yet.