MQSMPO (Set message property options) on IBM i

The MQSMPO structure allows applications to specify options that control how properties of messages are set.


Overview

Purpose: The structure is an input parameter on the MQSETMP call.

Character set and encoding: Data in MQSMPO must be in the character set of the application and encoding of the application (ENNAT).


Fields

The MQSMPO structure contains the following fields; the fields are described in alphabetical order:

    SPOPT (10-digit signed integer)
    Location options: The following options relate to the relative location of the property compared to the property cursor:

      SPSETF
      Sets the value of the first property that matches the specified name, or if it does not exist, adds a new property after all other properties with a matching hierarchy.

      SPSETC
      Sets the value of the property pointed to by the property cursor. The property pointed to by the property cursor is the one that was last inquired using either the IPINQF or the IPINQN option.

      The property cursor is reset when the message handle is reused, or when the message handle is specified in the HMSG field of the MQGMO structure on an MQGET call or the MQPMO structure on an MQPUT call.

      If this option is used when the property cursor has not yet been established or if the property pointed to by the property cursor has been deleted, the call fails with completion code CCFAIL and reason code RC2471.

      SPSETA
      Sets a new property after the property pointed to by the property cursor. The property pointed to by the property cursor is the one that was last inquired using either the IPINQF or the IPINQO option.

      The property cursor is reset when the message handle is reused, or when the message handle is specified in the HMSG field of the MQGMO structure on an MQGET call or the MQPMO structure on an MQPUT call.

      If this option is used when the property cursor has not yet been established or if the property pointed to by the property cursor has been deleted, the call fails with completion code CCFAIL and reason code RC2471.

    For none of the options described, use the following option:

      SPNONE
      No options specified.

    This is always an input field. The initial value of this field is SPSETF.

    SPSID (10-digit signed integer)

    This is the structure identifier; the value must be:

      SPSIDV

      Identifier for set message property options structure.

    This is always an input field. The initial value of this field is SPSIDV.

    SPVAKCSI (10-digit signed integer)

    The character set of the property value to be set if the value is a character string.

    This is always an input field. The initial value of this field is CSAPL.

    SPVALENC (10-digit signed integer)

    The encoding of the property value to be set if the value is numeric.

    This is always an input field. The initial value of this field is ENNAT.

    SPVER (10-digit signed integer)

    This is the structure version number; the value must be:

      SPVER1
      Version-1 set message property options structure.

    The following constant specifies the version number of the current version:

      SPVERC
      Current version of set message property options structure.

    This is always an input field. The initial value of this field is SPVER1.


Initial values

Field name Name of constant Value of constant
SPSID SPSIDV 'SMPO'
SPVER SPVER1 1
SPOPT SPNONE 0
SPVALENC ENNAT Depends on environment
SPVALCSI CSAPL -3


RPG declaration

     D* MQSMPO Structure
     D*
     D*
     D* Structure identifier
     D  SPSID                  1      4    INZ('SMPO')
     D*
     D* Structure version number
     D  SPVER                  5      8I 0 INZ(1)
     D*
     ** Options that control the action of
     D* MQSETMP
     D  SPOPT                  9     12I 0 INZ(0)
     D*
     D* Encoding of Value
     D  SPVALENC              13     16I 0 INZ(273)
     D*
     D* Character set identifier of Value
     D  SPVALCSI              17     20I 0 INZ(-3)
Parent topic: Data type descriptions on IBM i