mumpsgtm-database

Is there any way to get GDE (Global Directory Editor) Raw unformatted values as output


I'm writing a utility in JavaScript to interact with GTM's GDE(Global Directory Editor). One of the things it needs to accomplish is to run the GDE SHOW -ALL command and get a listing of all information in the Global Directory. However, SHOW command formats the values for display in terminal environment, which is unusable for my purpose, without extensive parsing.

Does anyone know of any ways to get the the Global Directory information unformatted(perhaps in key-value pairs/zwrite format)? If GDE can't provide that, are there any ways or algorithms to read the actual Global Directory File, to get that information?


Solution

  • GDE has a command that prints out the list of commands to regenerate the GDE. That can be easily parsed.

    > $gtm_dist/mumps -run GDE show -command -file="gde.cmd"
    > head -6 gde.cmd
    
    TEMPLATE -REGION -NOAUTODB
    TEMPLATE -REGION -COLLATION_DEFAULT=0
    TEMPLATE -REGION -EPOCHTAPER
    TEMPLATE -REGION -NOINST_FREEZE_ON_ERROR
    TEMPLATE -REGION -JOURNAL=(ALLOCATION=2048,AUTOSWITCHLIMIT=8386560,BEFORE_IMAGE,BUFFER_SIZE=2312,EXTENSION=2048)
    > tail -6 gde.cmd
    ADD -REGION DEFAULT -DYNAMIC_SEGMENT=DEFAULT
    !
    ADD -SEGMENT DEFAULT -FILE_NAME="mumps.dat"
    !
    LOCKS -REGION=DEFAULT
    !
    

    Note that "Template" corresponds to configuration that is common to all/most regions. Any exception is logged under the individual region/segment.

    Also note that the latest GT.M release (V7.0-000) removed ^%DSEWRAP.