MQPMR (Put-message record) on IBM i
The MQPMR structure is used to specify various message properties for a single destination when a message is being put to a distribution list.
Overview
Purpose: MQPMR is an input/output structure for the MQPUT and MQPUT1 calls.
Character set and encoding: Data in MQPMR must be in the character set given by the CodedCharSetId queue manager attribute and encoding of the local queue manager given by ENNAT. However, if the application is running as an IBM MQ client, the structure must be in the character set and encoding of the client.
Usage: By providing an array of these structures on the MQPUT or MQPUT1 call, it is possible to specify different values for each destination queue in a distribution list. Some of the fields are input only, others are input/output.
Note: This structure is unusual in that it does not have a fixed layout. The fields in this structure are optional, and the presence or absence of each field is indicated by the flags in the PMPRF field in MQPMO. Fields that are present must occur in the following order :- PRMID
- PRCID
- PRGID
- PRFB
- PRACC
Fields that are absent occupy no space in the record.
Because MQPMR does not have a fixed layout, no definition of it is provided in the COPY file. The application programmer should create a declaration containing the fields that are required by the application, and set the flags in PMPRF to indicate the fields that are present.
Fields
The MQPMR structure contains the following fields; the fields are described in alphabetical order:
- PRACC (32-byte bit string)
-
Accounting token.
This is the accounting token to be used for the message sent to the queue with a name that was specified by the corresponding element in the array of MQOR structures provided on the MQOPEN or MQPUT1 call. It is processed in the same way as the MDACC field in MQMD for a put to a single queue. See the description of MDACC in MQMD (Message descriptor) on IBM i for information about the content of this field.
If this field is not present, the value in MQMD is used.
This is an input field.
- PRCID (24-byte bit string)
-
Correlation identifier.
This is the correlation identifier to be used for the message sent to the queue with the name that was specified by the corresponding element in the array of MQOR structures provided on the MQOPEN or MQPUT1 call. It is processed in the same way as the MDCID field in MQMD for a put to a single queue.
If this field is not present in the MQPMR record, or there are fewer MQPMR records than destinations, the value in MQMD is used for those destinations that do not have an MQPMR record containing a PRCID field.
If PMNCID is specified, a single new correlation identifier is generated and used for all of the destinations in the distribution list, regardless of whether they have MQPMR records. This is different from the way that PMNMID is processed (see PRMID field).
This is an input/output field.
- PRFB (10-digit signed integer)
-
Feedback or reason code.
This is the feedback code to be used for the message sent to the queue with the name that was specified by the corresponding element in the array of MQOR structures provided on the MQOPEN or MQPUT1 call. It is processed in the same way as the MDFB field in MQMD for a put to a single queue.
If this field is not present, the value in MQMD is used.
This is an input field.
- PRGID (24-byte bit string)
-
Group identifier.
This is the group identifier to be used for the message sent to the queue with the name that was specified by the corresponding element in the array of MQOR structures provided on the MQOPEN or MQPUT1 call. It is processed in the same way as the MDGID field in MQMD for a put to a single queue.
If this field is not present in the MQPMR record, or there are fewer MQPMR records than destinations, the value in MQMD is used for those destinations that do not have an MQPMR record containing a PRGID field. The value is processed as documented in Table 1, but with the following differences:- In those cases where a new group identifier would be used, the queue manager generates a different group identifier for each destination (that is, no two destinations have the same group identifier).
- In those cases where the value in the field would be used, the call fails with reason code RC2258.
This is an input/output field.
- PRMID (24-byte bit string)
-
Message identifier.
This is the message identifier to be used for the message sent to the queue with the name that was specified by the corresponding element in the array of MQOR structures provided on the MQOPEN or MQPUT1 call. It is processed in the same way as the MDMID field in MQMD for a put to a single queue.
If this field is not present in the MQPMR record, or there are fewer MQPMR records than destinations, the value in MQMD is used for those destinations that do not have an MQPMR record containing a PRMID field. If that value is MINONE, a new message identifier is generated for each of those destinations (that is, no two of those destinations have the same message identifier).
If PMNMID is specified, new message identifiers are generated for all of the destinations in the distribution list, regardless of whether they have MQPMR records. This is different from the way that PMNCID is processed (see PRCID field).
This is an input/output field.
Initial values
There are no initial values defined for this structure, as no structure declaration is provided. The following sample declaration shows how the structure should be declared by the application programmer if all of the fields are required.
RPG declaration
D*..1....:....2....:....3....:....4....:....5....:....6....:....7.. D* MQPMR Structure D* D* Message identifier D PRMID 1 24 D* Correlation identifier D PRCID 25 48 D* Group identifier D PRGID 49 72 D* Feedback or reason code D PRFB 73 76I 0 D* Accounting token D PRACC 77 108