#Globals

0 Followers · 227 Posts

Globals are multidimensional sparse arrays which are stored in InterSystems Data Platform. Everything in InterSystems Products is stored in Globals: Classes, Tables, Documents, Code.

Documentation.

Article Eduard Lebedyuk · Aug 3, 2020 3m read

InterSystems IRIS currently limits classes to 999 properties.

But what to do if you need to store more data per object?

This article would answer this question (with the additional cameo of Community Python Gateway and how you can transfer wide datasets into Python).

The answer is very simple actually - InterSystems IRIS currently limits classes to 999 properties, but not to 999 primitives. The property in InterSystems IRIS can be an object with 999 properties and so on - the limit can be easily disregarded.

13
1 817
Question Sukhpreet Singh · Jul 15, 2023

I have created a global say ^myglobal and entered some data. I am storing the name of global in databases and fetching the name based on some criteria. I am getting "^myglobal" in return from databases but i am not able to fetch the data I stored in the global. 

I tried set var = result.global which gives me "^myglobal" in var. Doing WRITE var will return "^myglobal" and not the data i stored in this global.

5
1 379
Article Mihoko Iijima · Jul 13, 2023 2m read

InterSystems FAQ rubric

It can be obtained by using the Size query of the system-provided %SYS.GlobalQuery class.

See the sample code below for usage examples.
*Please check the class reference for specifying columns and parameters.

 set dir="C:\intersystems\iris\mgr\user" // IRIS.DAT(or CACHE.DAT) folder
 set rs = ##class(%ResultSet).%New("%SYS.GlobalQuery:Size")
 do rs.Execute(dir) // You can also specify a mask with the 3d parameter
 while (rs.Next()) { 
   set gname= rs.Get("Name") // global name
   set gsize= rs.Get("Used MB") // global size (MB)
   write gname," : ",gsize,!
 }
0
2 555
Question Lakshmi Ankireddipalli · Jun 16, 2023

We are trying to come up with huge DataStore which needs to store HIPAA transactions and Data getting partitioned with idkey - YYYYMM.  Current Live data get inserted into current Month DB -  HIPAA_202306. 10 years (Hipaa retention policy) old data is going to be sitting in to 120 DBs ( 201606_HIPAA, 201607... 202305) for historical audit legal compliance purposes.

Currently if we create Namespace we get 2 databases - CODEDB for routes/classes & DATADB for journals data.  

In our requirement, Global mapping should point to 120 DataDbs. How would we Map/design this using Globals. 

7
0 406
Question Norman W. Freeman · Jun 9, 2023

Hello,

I would like to get a list of all globals that have been read or written during a given context. In Portal, there are counters in dashboard that give the number of read/write to globals in general.

What I am looking for : 

- some handler (eg: like $ZTRAP) that will be called everytime something is read/written to a global.

- to activate a "global log mode" in Portal that will dump some information to a file (like ^ISCSOAP for SOAP requests).

I understand this is something that can considerably slow down IRIS, but it's intended to be used only for debbuging and under no load.

2
0 319
Question Lucas Galdino · Apr 27, 2023

Dear experts,
Please, could you help me?

Im trying import a global:

ACB> K ^GlobalManualSend
ACB> D $System.OBJ.Load("C:\Users\BNAPC\GlobalManualSend.xml")
ACB> Set sc = ##class(%Studio.Project).InstallFromGbl("^GlobalManualSend","fv")

But is returning a error about version:

Please, could you help me about it?

Thank you.

5
0 306
Question Punit · Apr 24, 2023

I have a %GlobalBinaryStream object that I'm trying to save as a local file after being received through a SOAP Web Service.

To do this, I created a %Stream.FileBinary object and wanted to set where the stream copied to this object would be saved by using either the DefaultStreamDir() ClassMethod or the NewFileName() ClassMethod. However, the documentation isn't very helpful on how to use these ClassMethods.

Right now, I have the below code:

4
0 281
Question Robert Cemper · Mar 17, 2023

During my last migration to IRIS I met this Compatibility parameter

  • NullSubscripts    true
0 - Throw error when referencing a null subscript.
1 - Null subscript references do not throw an error.

The consequences are shocking. This was allowed:

USER>zw^rcc^rcc=0^rcc("")="***"^rcc("",1)="*,1"^rcc(1,"")="1,*"^rcc(1,2)="1,2"^rcc(1,2,"")="1,2,*"

But SMP had no idea what is going on. 

And after switching off that flag this was still partialy visible, but read-only

USER>zw^rcc^rcc=0^rcc(1,"")="1,*"^rcc(1,2)="1,2"^rcc(1,2,"")="1,2,*"

I just don't understand.

5
0 371
Article Brendan Bannon · Aug 29, 2016 7m read

The Art of Mapping Globals to Classes 1 of 3

Looking to breathe new life into an old MUMPS application?  Follow these steps to map your existing globals to classes and expose all that beautiful data to Objects and SQL.

By following the simple steps in this article and the next two you will be able to map all but the craziest globals to Caché classes.  For the crazy ones I will put up a zip file of different mappings I have collected over the years.  This is NOT for new data; if you don’t already have existing global please just use the default storage.

26
12 6088
Question Norman W. Freeman · Feb 15, 2023

Out of curiosity, I was looking in ^ROUTINE global to see how routines are stored internally.

I found out that lot of nodes are displaying "~pointer" as associated value (eg: instead of a string).

What are those pointers ? My guess is that it references some cache internal structure (eg: some nodes inside a B-Tree).

Is there a easily way to see what is behind ? Are pointers useful for user globals or is this something purely internal to Cache database ?

1
0 279
Article Robert Cemper · Jan 30, 2023 2m read

The similarity between JSON objects + arrays and Globals in IRIS or Caché is evident.
With small and medium size JSON objects navigation across %Dynamic Objects is comfortable.
But with large and/or deep cascaded objects it becomes a challenge.

The presented tool offers 3 variants

  • loading an already existing %Dyamic object or Array into a global of your choice
  • loading a %Stream containing a JSON object into a global of your choice
  • loading an external File containing a JSON object into a global of your choice
1
2 300
Question Norman W. Freeman · Jan 19, 2023

I have noticed that the way the nodes are ordered is different between 2 different environments.

If I create the following global :

set^TEMP("Z")=1set^TEMP("Ä")=1

Then I dump it with zwrite, I get this (which is expected):

^TEMP("Z")=1^TEMP("Ä")=1

However, on another machine, it gives me this :

^TEMP("Ä")=1^TEMP("Z")=1

The same goes for the following command (which return 0 or 1, depending environment) : 

write"Z"]]"Ä"

Both are running Windows 10, but one is running IRIS 2021.1, the other CACHE 2017.2.2.

5
0 251
Question Martin Staudigel · Jan 9, 2023

Hello community,

is there anything special to consider when running a foundation production regarding purge jobs (Ens.Util.Tasks.Purge)? I am thinking specifically of the QuickStreams, which according to my information are stored in a temporary database until the system is restarted. Since a system reboot is much less frequent then the purges, I wonder what happens to the QuickStreams whose messages and headers have already been purged. Is there a way to view Quickstreams (not content, but rather metadata) e.g. via the Management Portal?

Thanks for your comments and hints,

best regards, Martin

3
0 245
Question Evgeny Shvarov · Oct 6, 2022

Hi folks!

I'm working with a global via Embedded Python as a class method. I init the handler for a global via:

gl=iris.gref("^Global")

What is the way to check the value at index ^Global("x","y")? E.g.:

In ObjectScript I'd do the following:

set result=$data(^Global("x","y"))

How do I do the same in Embedded Python?

I checked the documentation, but haven't found an answer.

4
0 251
Article Muhammad Waseem · Sep 20, 2022 8m read

Hi Community,
In this article, I will introduce Python Flask Web Framework. Together we will create a minimal web application to connect to IRIS and get data from it.
Below you can find the steps we will need to follow:

  • Step 1 : Introduction to Python Flask Web Framework
  • Step 2 : Installation of Flask module
  • Step 3 : Creation of web application using Flask
  • Step 4 : Use of HTML Templates 
  • Step 5 : Installation of IRIS Python Native module
  • Step 6 : Establishment of a connection with IRIS 
  • Step 7 : Transferring data from IRIS to Flask and displaying it

So Let's start with step 1

2
1 879
Question Craig Bishop · Sep 7, 2022

Hello All,

I have a class method on the DocRepo server that needs to query the data value of a global variable on the Edge server. 

I have looked at the documentation for 'Global Structure,' but I didn't find anything that helped.

Global Structure | Using Globals | InterSystems IRIS Data Platform 2022.1
 

I am able to access this global easily from the Edge server using the $Get function, but I need to access it from the DocRepo server.

Any suggestions would be greatly appreciated!

Thanks!

Craig

8
0 442
Question Mark OReilly · Aug 24, 2022

I am using $Query to loop through a global. 

When I use $GET to get the data all we get back is the global name. 

How do you get the value of the global after you have looped. 

Below is my example in terminal. 

Thank you in advance 

Set node = $Query(^FromExtraMed("")) 

w node
^FromExtraMed("A02",9220)

If i try w $GET(node) it returns 

^FromExtraMed("A02",9220)

If i had this hardcoded it would have got the value

w $GET(^FromExtraMed("A02",9220))
0,66340,2120

I have already read the documentation and it is not clear. Can someone advise? 

5
0 334
Article Yuri Marx · Aug 8, 2022 24m read

In this article you will have access to the curated base of articles from the InterSystems Developer Community of the most relevant topics to learning InterSystems IRIS. Find top published articles ranked by Machine Learning, Embedded Python, JSON, API and REST Applications, Manage and Configure InterSystems Environments, Docker and Cloud, VSCode, SQL, Analytics/BI, Globals, Security, DevOps, Interoperability, Native API. Learn and Enjoy!

Machine Learning

6
7 1021
Question Mark OReilly · Jul 4, 2022

Hi there have been various posts around how to clean up globals without parent data but none have gone into how you solve these issues. 

Our database is approaching 600gb in size so i am looking into how to reduce this. 

We use standard purge tasks. 

Our cache stream class has a global size of 2463243 from running global size so it is what i would like to tackle first. 

1) is there any way i can find based on my oldest message session for where most of these globals 

2) in the class where these are created what can be done to ensure purping. Basically we have 

3
0 807