CAN CSA Z243.181-89 amd1-1999: COBOL Binding for the Graphical Kernel System (GKS)

Technical Overview and Compliance Guidelines for the Canadian Adoption of the International Standard for the GKS COBOL Language Binding

Scope and Purpose

CAN CSA Z243.181-89 amd1-1999 is the Canadian adoption of the international standard that specifies the COBOL language binding for the Graphical Kernel System (GKS). GKS, originally defined in ISO 7942, provides a set of basic functions for computer graphics programming, enabling device-independent output and input operations. This binding standard defines how GKS functions are mapped to the COBOL programming language, including subroutine names, parameter lists, data types, and error handling conventions.

The first edition (1989) established the initial binding, while Amendment 1 (1999) introduced clarifications, additional functionality, and alignment with the evolving GKS standard (ISO 7942:1994). The standard is part of the Z243 series under the Canadian Standards Association (CSA), covering Information Technology.

The primary audience includes developers implementing GKS in COBOL environments, compiler vendors, and conformance testers who require a precise specification for subroutine interfaces and data structures.

Technical Requirements

Function Mapping and Data Types

The binding specifies how each GKS function, such as polyline, text, or cell array, is represented as a COBOL subprogram call. A summary of the functional groups and their corresponding subroutine prefixes is given in the table below.

GKS Functional GroupCOBOL Subroutine PrefixNumber of Functions
Control FunctionsGC15
Output FunctionsGO9
Input FunctionsGI11
Segment FunctionsGS8
Workstation FunctionsGW12
Inquiry FunctionsGQ28
Utility FunctionsGU5

Data types are mapped to COBOL equivalents: integer indexes become PIC S9(9) BINARY, real numbers become PIC S9(6)V9(6) COMP, and geometric points are represented as GROUP items with two coordinates. Named constants for GKS states and attribute settings are provided as PERFORM constants in a dedicated COPY library.

Error Handling and State Lists

Each GKS function returns an error code in a dedicated output parameter. The binding defines a standard error list (ERROR LIST) that must be updated after each call. The 1999 amendment introduced an extended set of error codes for new GKS functionality, including errors for geometric transformations and multiple workstation precedence.

Tip: Implementers should pay special attention to the COBOL PERFORM linkage for subprograms. The standard requires that all GKS functions be called using CALL ... USING with a fixed order of arguments. Using the provided error list parameter can prevent silent failures in batch graphics processing.

Implementation Highlights

Subroutine Naming Conventions

Every GKS function starts with the letter G followed by a category prefix encoded as a single character, then a two-digit number. For example, GCLI (Create List of Line Types) belongs to Control functions. Amendment 1 standardized the naming for all new functions using the same pattern, ensuring consistency with existing implementations.

Data Types and Enumerations

COBOL lacks built-in enumerated types; therefore, the binding uses numeric constants defined in COPY GKS-CONSTANTS. This copybook includes values for line styles, fill area interior styles, text alignment, and input device classes. Amendment 1 added constants for new GKS functionality, including the SET and SETS data types for geometric transformations.

Warning: The 1999 amendment changed the numeric values for several attribute constants to align with ISO 7942:1994. Legacy COBOL programs using the 1989 values will produce incorrect graphical output unless the copybook is updated to the amended version. A full migration guide is included in Annex B of the standard.

Amendment 1 Enhancements

The amendment introduced the following key changes:

  • Additional Workstation Types – Support for new output devices (e.g., raster displays with customizable color tables).
  • Improved Inquiry Functions – New subroutines to retrieve the current transformation state and the set of active segment names.
  • Segment Priority Management – Functions to reorder segments in the workstation’s display list, with COBOL parameters for priority levels.
  • Error List Extension – Eight new error codes covering invalid transformation matrices and unsupported device features.

Compliance and Conformance Testing

Conformance to CAN CSA Z243.181-89 amd1-1999 is verified through testing of both the subroutine interface and the resulting graphics output. The following aspects are evaluated:

  • Interface Conformance – Each GKS function must be accessible with the exact parameter list and data types specified. Compiler vendors provide a conformance test suite that checks subroutine signatures and error handling.
  • Semantic Conformance – The actual graphical results (output primitives, transformations, input feedback) must match the GKS abstract specification when called via the COBOL binding. This is typically verified using a reference implementation.
  • Documentation Compliance – The user documentation must include the COPY element names and the mapping tables as described in the standard.
Success: Many production COBOL graphics applications continue to rely on this standard for generating technical drawings and charts. The 1999 amendment improved portability across platforms and compilers, making it easier to integrate legacy systems with modern hardware.
Danger: The standard is considered deprecated by many vendors in favor of GKS-94 or the newer PHIGS and OpenGL bindings. However, it remains critical for maintaining long-lived industrial control systems and legacy plotting software. Developers are advised to plan migration strategies while respecting the stability guarantees provided by the CSA standard.

Frequently Asked Questions

Q: What is the relationship between CAN CSA Z243.181-89 amd1-1999 and ISO standards?
A: This standard is the Canadian adoption of ISO 8651-2:1994 (the GKS FORTRAN binding) with modifications for the COBOL language. It references ISO 7942 for the GKS functional specification. The 1999 amendment aligns with the second edition of ISO 7942 and adds COBOL-specific clarifications.
Q: Which COBOL compilers are supported?
A: The binding is designed to be compiler-neutral, but it specifically addresses IBM COBOL (OS/VS and later), Micro Focus COBOL, and Digital COBOL for VMS. A compatibility appendix maps the BINARY and COMP data types to the storage sizes of these environments.
Q: Are there known limitations in the amendment?
A: Yes. The amendment does not specify the behavior for overlapping segment transformations in multi-threaded environments (COBOL at the time lacked thread support). Implementers must handle synchronization at the application level. Additionally, the input device echo specification remains optional, and workstations may choose to ignore echo settings without error.
Q: Where can I obtain the conformance test suite?
A: The CSA provides a self-testing toolkit for interface conformance as part of the standard package. The toolkit includes a master COBOL source file that exercises every function and prints a diagnostic report. Contact CSA Group for ordering details (product code Z243.181-99-TS).

📥 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 *