About Natural Messaging

This section covers the following topics:


What is Natural Messaging?

Natural Messaging allows for direct integration with messaging systems, enabling Natural users to easily exchange data.

All interactions with IBM MQ are handled through the Natural Messaging interface.

  • The PROCESS statement is used to put messages on queues or retrieve them.

  • The FIND statement is used to browse queues.

Natural Messaging enables Natural on z/OS to seamlessly send and receive messages via IBM MQ, enabling smooth integration with other MQ-based systems and applications.

Natural Messaging and IBM MQ

Components of Natural Messaging

The Natural interface for messaging consists of the following components:

  • The NMQNUC module, which is mandatory, environment-independent, and delivered as a load module only. This module is linked to the shared nucleus.

  • The NMQTAB module, which is also mandatory and delivered as a load module only. This module is linked to the frontend.

  • DDMs for MQ access, which are delivered with the NMQ INPL file.

Environment-Specific Considerations

Natural Messaging provides seamless integration with IBM MQ, enabling Natural applications to send and receive messages via MQ queues. It is suitable for high-performance transactional applications running in z/OS environments.

Natural Messaging operates in the following environments:

  • Com-plete

  • CICS

  • Batch

  • TSO

Note
Under CICS, Natural Messaging integrates with IBM MQ via the MQ Adapter for CICS. Both conversational and pseudo-conversational modes are supported.

This section covers the following topics:

Supported Queue Types

Natural Messaging can access the following MQ object types:

  • Local queues

Natural Messaging supports both persistent and non-persistent messages, and can process messages in FIFO (First In First Out) or priority-based order depending on the queue configuration.

Message Access Modes

Natural Messaging supports:

  • GET with WAIT and NOWAIT options.

  • Browsing (read and keep message) and destructive GET (read and remove message).

  • CorrelId- and MsgId-based filtering.

Performance and Optimization

Natural Messaging is optimized for high-performance messaging via:

  • Connection reuse across MQ calls.

  • Object handle reuse wherever possible.

  • Efficient memory usage for message buffers.

Queue open and close operations are minimized through pooling.

Linking Requirements for Natural Messaging with IBM MQ

For Natural Messaging to interface with IBM MQ, the environment-dependent nucleus for each runtime environment must be linked with the following modules:

  • NMQTAB (Natural Messaging interface configuration table)

  • IBM MQ stub program (specific to the environment)

IBM MQ stub programs by environment:

Environment Required IBM MQ Stub Program
Com-plete CSQBSTUB (batch MQ stub program)
CICS CSQCSTUB (CICS MQ stub program)
TSO CSQBSTUB (batch MQ stub program)
Batch CSQBSTUB (batch MQ stub program)

For detailed installation instructions, see Installing Natural Messaging in the Installation for z/OS documentation.

Natural Messaging under Com-plete

Task affinity is required in Com-plete during MQ operations (such as the execution of the PROCESS statement or within a FIND loop) to ensure correct execution. This is because MQ internally relies on the same task context to maintain consistency between requests and completions.

In Natural Messaging under Com-plete, task affinity is forced internally during MQ call operations.

When using MQ with Com-plete, configure a sufficient number of tasks to accommodate affinity requirements and avoid system slowdowns.

PUT and GET operations are performed immediately. They become permanent and cannot be rolled back.

Natural Messaging under CICS

The following runtime conditions must be met when using Natural Messaging under CICS:

  • The CICS region must be connected to a queue manager through the MQ CICS adapter before any messaging operations can be performed.

  • Transactional behavior: In the current version - particularly in CICS environments - PUT and GET operations are performed with a SYNCPOINT, making them transactional.

    Message operations are committed under the following circumstances:

    • Upon a terminal I/O in a pseudo conversation session where the end-of-transaction results in a SYNCPOINT commit.

    • By means of the END TRANSACTION statement. To use this option, you must set the parameter ETSYNC=ON.

    • At the end of the session.

Natural Messaging under Batch and TSO

There are no additional environment-specific considerations beyond the standard linking and runtime requirements, which are similar to those in other environments.

PUT and GET operations are performed immediately. They become permanent and cannot be rolled back.

General Runtime Considerations for Natural Messaging

This section covers runtime behaviors across all supported environments (Batch, TSO, CICS, and Com-plete).

When a BROWSE operation is performed, an implicit internal commit is automatically triggered by Natural before executing the BROWSE, except in the CICS environment..

The message retrieved from or written to an MQ queue is held in one of the internal buffers managed by Natural Messaging. Therefore, ensure that the Natural thread size is configured sufficiently to accommodate the size of the message being processed.

Terms Used in this Documentation

Term Explanation
MQ MQ refers to IBM's MQ for z/OS.
DDM Data definition module.
NMQ This is the product code of Natural Messaging. In this documentation, the product code is often used as prefix in the names of data sets, modules, etc.