Comprehensive Guide to ISO/IEC 11756: Standard for the MUMPS Programming Language (CAN/CSA-ISO/IEC 11756-02)

Scope, Technical Requirements, and Compliance of the MUMPS Language Standard

ISO/IEC 11756 (adopted as CAN/CSA-ISO/IEC 11756-02 in Canada) is the international standard that defines the syntax, semantics, and runtime behavior of the MUMPS programming language—often simply called M. Originally designed for healthcare information systems, MUMPS has evolved into a general-purpose language with unique features for hierarchical data management and multi‑user transaction processing. This article examines the standard’s scope, key technical requirements, implementation highlights, and compliance guidelines.

Scope and Application

The standard formally known as ISO/IEC 11756:1999 and its Canadian adoption CAN/CSA-ISO/IEC 11756-02 specify the form and content of a MUMPS program, the data types supported, the rules for variable scope and persistence, and the behavior of built‑in functions and commands. It is intended for implementers of MUMPS interpreters, compilers, and runtime environments, as well as for developers writing portable MUMPS applications.

Note: Although the standard originated in 1999, the “-02” suffix reflects the year of Canadian adoption (2002). Many implementations also comply with later revisions, but this edition remains the definitive reference for conformance testing in North America.

The scope covers:

  • Full lexical and syntactic grammar of MUMPS.
  • Core commands (e.g., SET, WRITE, READ, DO, GOTO, FOR, IF, ELSE) and operators.
  • Intrinsic special variables (e.g., $HOROLOG, $JOB, $IO, $ZVERSION).
  • Intrinsic functions (e.g., $PIECE, $EXTRACT, $ORDER, $DATA, $FIND).
  • The hierarchical persistent array model (global variables).
  • Transaction processing primitives (TLOCK, TCOMMIT, TROLLBACK).
  • I/O device handling and error trapping.

Implementations claiming conformance must support all mandatory elements described in the standard and document any extensions or deviations.

Technical Requirements

Syntax and Data Types

MUMPS uses an extremely compact syntax where whitespace is significant. Statements are composed of a line label (optional), a command, and arguments separated by spaces. The standard defines a single data type – a string – but numeric interpretation is allowed in arithmetic contexts. Empty strings are valid and can represent logical false.

Key data elements include:

  • Local variables (process‑specific, erased on process termination).
  • Global variables (persistent, hierarchical arrays stored on disk or shared memory).
  • Intrinsic variables (system‑provided, e.g., $HOROLOG for date/time).

Hierarchical Data Structures

A defining characteristic of MUMPS is its global array model. A global is a sparse, tree‑structured persistent map of strings to strings, indexed by subscripts of any number of levels. For example:

 SET ^Patient("12345","Name")="John Doe"

The standard prescribes the exact semantics for ordering, subscript evaluation, and the operations $ORDER, $QUERY, $DATA, and KILL. This model enables applications to dynamically create and query nested data without a schema.

Implementation Tip: Use $ORDER for forward/backward traversal of global subscripts. It is far more efficient than iterating over possible numeric indices.

Transaction Processing and Concurrency

Multi‑user environments rely on the MUMPS transaction model. The standard defines TLOCK (acquire/release locks), TSTART, TCOMMIT, and TROLLBACK to ensure atomicity and consistency. Lock granularity is per variable (global or local). The standard requires that updates to globals within a transaction be atomic and recoverable in case of a system crash.

Common Pitfall: Not releasing locks due to unhandled exceptions can cause deadlocks. Always pair TLOCK with an error handler that calls TROLLBACK or LOCK -@variable.

Implementation Highlights

To produce a conforming implementation, developers must address the following:

  • Compilation vs. Interpretation: The standard allows either. Most legacy systems use interpreted byte code, but modern implementations (e.g., GT.M, Caché ObjectScript) compile to native or p‑code.
  • String handling performance: Since there is only one data type, string operations must be optimized. Many implementers use a string pool and reference counting.
  • Global storage engine: The underlying storage of globals can be a B‑tree, hash table, or custom journaling system. The standard requires that $ORDER traversal returns subscripts in collating order.
  • Compatibility with ANSI X11.1: ISO/IEC 11756 closely follows the earlier ANSI MUMPS standard (X11.1). Implementations should document which edition they supersede for seamless migration.

The table below summarises the main compliance levels defined by the standard:

Compliance Level Description Required Elements
Full Complete implementation of all mandatory features All commands, functions, special variables, globals, transaction processing, I/O, error handling
Embedded Subset for use as a scripting language within a host environment Core commands, local variables, limited I/O, no transaction processing
Partial (deprecated) Implementation that omits certain optional features but documents the omissions Must at least support SET, DO, WRITE, READ, GOTO, and local arrays
Benefit of Compliance: Applications written to the standard are portable across GT.M, Cache ObjectScript, and other compliant systems with minimal modification. This is crucial for health‑care and financial applications that require long‑term stability.

Compliance and Certification

Conformance to ISO/IEC 11756 is generally demonstrated through a self‑declaration, although third‑party test suites exist (e.g., the MUMPS Validation Suite developed by the MDC). The Canadian Standard CAN/CSA-ISO/IEC 11756-02 includes a normative annex that lists recognized deviations and corrigenda. Adopters should:

  1. Verify that all mandatory syntax and semantics are implemented.
  2. Document any extensions (e.g., object‑oriented features, Unicode support) as non‑standard.
  3. Ensure that global arrays conform to the standard’s ordering and persistence requirements.

For organizations upgrading from older MUMPS dialects, the standard provides a migration guide (Informative Annex B) that highlights differences from pre‑1999 implementations.

Heads up: The current ISO/IEC 11756:1999 edition does not include object‑oriented syntax or Java/.NET interoperability. These features are common in proprietary extensions but are not part of the standard. Always isolate non‑standard features behind compatibility layers.

Frequently Asked Questions

Q: What is the difference between ISO/IEC 11756 and the older ANSI X11.1?
A: ISO/IEC 11756:1999 is essentially an international adoption of ANSI X11.1-1995 with minor editorial changes. It retains the same language core but includes updated references and corrections to error handling. CAN/CSA-ISO/IEC 11756-02 adds a Canadian foreword and a list of recognized national deviations.
Q: Can I run a program written under Caché ObjectScript on a standard‑conforming implementation?
A: Only if the program restricts itself to features mandated by ISO/IEC 11756. Caché ObjectScript includes many extensions (e.g., classes, % routines, embedded SQL) that are not part of the base standard. Use the ‘M’ compatibility mode (if available) to ensure portability.
Q: Does the standard require a specific character encoding?
A: The standard defines the source character set as 7‑bit ASCII (character codes 32–126 plus control codes). However, many modern implementations also support UTF‑8 when operating in extended mode. Such support is allowed as a conforming extension if documented.
Q: Where can I obtain the official standard document?
A: The full text of ISO/IEC 11756:1999 is available from ISO or your national standards body (e.g., CSA Group for CAN/CSA-ISO/IEC 11756-02). Some historical drafts are also available on the MUMPS Development Committee (MDC) website.

Revision note: This article references ISO/IEC 11756:1999 and CAN/CSA-ISO/IEC 11756-02. All comments regarding conformance refer specifically to the 1999 edition and its Canadian adoption. Check with your standards body for the latest amendments. — Published 2026.

📥 Standard Documents Download

🔒
Please wait 10 seconds, the download links will appear after the ad loads

Leave a Reply

Your email address will not be published. Required fields are marked *