Question
· Nov 14, 2017

How to get the Size of the Global Subscript

Hi All, Can you please tell me how to get the Size of the Global Subcript.
In Cache 2016 - they are using ##Class(%GlobalEdit).GetGlobalSizeBySubscript()
For Older version how to get the GlobalSize of the Subscript.
Because the method is not exist in Older Versions and all.

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

On previous versions you can use ^%GSIZE utility:

do ^%GSIZE
Directory name: c:\intersystems\cache\mgr\mdx2json\ =>
 
All Globals? No => No
Global ^Git("TSH")
Global ^
1 global selected from 54 available globals.
Show details?? No => Yes
Device:
Right margin: 80 =>

directory: c:\intersystems\cache\mgr\mdx2json\
Page: 1                           GLOBAL SIZE                        16 Nov 2017
                                                                        11:49 AM
      Global        Blocks       Bytes Used  Packing   Contig.
      --------    --------  ---------------  -------   -------
      Git("TSH")         1              132      2 %         0
 
 
      TOTAL         Blocks       Bytes Used  Packing   Contig.
      --------    --------  ---------------  -------   -------
                         1              132      2 %         0
                                        <RETURN> to continue or '^' to STOP:

If you have an equivalent version of Cache installed with the manager source code available then take a look at briefsub^%GSIZE. 

You can copy this code and amend as you require, remember to include the sub routines it calls and you will have to set a few things up first.  I've done similar things in the past on older systems, the code can look daunting at first but isn't hard to understand enough to use.

On newer systems you would use the %Library.GlobalEdit class.