Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

MERGE

M[UMPS] by Example

Introduced in the 1995 ANSI M[UMPS] language standard.

Initialize the arrays ^A and ^B as:

Kill ^A,^B
Set ^A(1,2)="First"
Set ^A(1,2,4)="Second"
Set ^B(5,6,7)="Third"
Set ^B(5,6,8)="Fourth"
Set ^B(5,6,7,8,1)="Fifth"
Set ^B(5,6,7,8,9)="Sixth"

The command Merge ^A(1,2)=^B(5,6,7) will cause the contents of ^A to be modified into:
^A(1,2)="Third"
^A(1,2,4)="Second"
^A(1,2,8,1)="Fifth"
^A(1,2,8,9)="Sixth"

A subsequent Merge ^A(1,2,3)=^B(5,6,7,8) will cause the contents of ^A to be modified into:

^A(1,2)="Third"
^A(1,2,3,1)="Fifth"
^A(1,2,3,9)="Sixth"
^A(1,2,4)="Second"
^A(1,2,8,1)="Fifth"
^A(1,2,8,9)="Sixth"

Note that no node ^A(1,2,3) is created.

Kill TMP
Set TMP("GLOBAL")="TESTGENV"
Set TMP("ROUTINE")="TESTRENV"
Set TMP("LOCK")="TESTGENV"
...
Merge ^$Job($Job)=TMP

Set up the parameters for working in a different environment, and activate those parameters in a single command.

Examples with naked references:

Merge TO=FROM
Set ^ABC(1,2)="reset naked indicator"
; naked indicator is now ^ABC(1,
Merge ^(3,4)=^(5,6)

; Pretend Set ^(3,4)=^(5,6) is executed
; 1. fetch ^(5,6) = ^ABC(1,5,6)
; 2. store ^(3,4) = ^ABC(1,5,3,4)
; naked indicator is now: ^ABC(1,5,3,

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

The information in this page is NOT authoritative and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an authoritative definition.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 15-Nov-2023, 14:46:00.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)