Customizing Natural Messaging

This section covers the following topics:


Customizing the Natural Parameter Module

To configure Natural Messaging, specific Natural parameters must be defined in the Natural parameter module. This parameter module should be customized to meet your site's standards, then assembled and linked using the appropriate installation jobs.

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

Defining the Database Type and Database ID (DBID)

To access messaging resources such as IBM MQ queues, Natural Messaging requires that a dedicated database ID (DBID) is defined as database type MQ . This logical assignment maps the DBID to the MQ database type, allowing Natural programs to interact with message queues through DDMs defined for IBM MQ queues.

This setup can be done in either of the following ways:

  • Statically, using the NTDB macro in the Natural parameter module.

    Example:

    NTDB MQ, mq-dbid
  • Dynamically, using the profile parameter DB.

    Example:

    DB=(MQ, mq-dbid)

Notes:

  1. Ensure that the DBID specified in the NTDB macro for Natural Messaging does not conflict with DBIDs assigned to other database management systems. This helps prevent misrouting and access issues in environments where multiple DBMS types are used.
  2. All MQ queue DDMs used in Natural applications must be associated with the same DBID defined in the NTDB macro or the DB parameter. This ensures consistent and correct access to messaging resources throughout the application.

Changing the DBID of the DDM Used for Natural Messaging

The provided DDM MQ-QUEUE enables Natural applications to interface with IBM MQ message queues. To integrate this DDM into a customer-specific environment, its DBID may need to be updated to match the DBID defined for messaging in your system configuration.

Step 1: Define the Desired DBID

Before updating the DDM, ensure that the required DBID is properly configured as described in Defining the Database Type and Database ID (DBID).

Step 2: Update the DBID in the DDM

  1. Start a Natural session and invoke the SYSDDM utility.

  2. Select the Read function (code R) and enter MQ-QUEUE as the DDM name. This loads the DDM into the source area.

  3. Change the DBID field to the required value to match your environment.

  4. Use the CATALOG REPLACE command to save the updated DDM.

  5. Once modified, the MQ-QUEUE DDM will be aligned with your Natural Messaging DBID, ensuring correct integration with your messaging setup.

Note
For more information, see SYSDDM Utility in the Editors documentation or contact support.

Changing the Length of the MESSAGE Field in the MQ-QUEUE DDM

To support larger message payloads in Natural Messaging, you may need to adjust the length of the MESSAGE field in the MQ-QUEUE DDM. Proceed as follows:

  1. Launch the SYSDDM utility in your Natural session.

  2. Select the Edit function (code E) and enter MQ-QUEUE as the DDM name.

  3. In the field list, locate the MESSAGE field (typically an alphanumeric field named MESSAGE (MG)).

  4. Update the field length to match the maximum message size required by your application.

    Note
    If your message content may exceed 253 characters, change the MESSAGE field using the LB (large binary) format instead of a standard A (alphanumeric) field. This enables support for large message payloads beyond the conventional field limits.

  5. After making changes, use the CHECK command to validate the DDM, followed by CATALOG REPLACE to save the changes. The updated DDM will now support larger or customized MQ message sizes at runtime, ensuring compatibility with your messaging workload.

Increasing the Natural Thread Size for Large MQ Payloads

When retrieving messages from MQ, both the message data and the internal MQ buffer are stored within the Natural thread.

Insufficient thread size can lead to runtime errors. To prevent these issues, adjust the Natural thread size parameters to safely accommodate larger MQ payloads.

For details on configuring thread size, see the THSIZE parameter in the Parameter Reference.