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(glb.data())
10
>>> print(glb.data([1])) 
1
>>> print(glb.data([2]))
10
>>> print(glb.data([3]))
0
>>> print(glb.data([4]))
11

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.

You can also try overriding the GUIDENABLED parameter from %Persistent:

Class User.Test1 Extends %Persistent

{

Parameter GUIDENABLED = 1;

Property Property1 as %String;

Storage Default

{

<Data name="Test1DefaultData">

<Value name="1">

<Value>%%CLASSNAME</Value>

</Value>

<Value name="2">

<Value>Property1</Value>

</Value>

</Data>

<DataLocation>^User.Test1D</DataLocation>

<DefaultData>Test1DefaultData</DefaultData>

<IdLocation>^User.Test1D</IdLocation>

<IndexLocation>^User.Test1I</IndexLocation>

<StreamLocation>^User.Test1S</StreamLocation>

<Type>%Library.CacheStorage</Type>

}


}

Will give you:

USER>set obj = ##class(Test1).%New()

USER>set obj.Property1 = "Hello"

USER>w obj.%Save()

1

USER>w obj."%%GUID"

FC381F94-277E-11E8-82F0-005056B479AA

The ^OBJ.GUID index that this creates can be accessed via %ExtentMgr.GUID.