Analyzing the report field
The Report field contains subfields; because of this, applications that need to check whether the sender of the message requested a particular report must use one of the techniques described.
Using bit operations
If the programming language supports bit operations, perform the following steps:
- Select one of the following values, according to the type of report to be checked:
- MQRO_COA_WITH_FULL_DATA for COA report
- MQRO_COD_WITH_FULL_DATA for COD report
- MQRO_EXCEPTION_WITH_FULL_DATA for exception report
- MQRO_EXPIRATION_WITH_FULL_DATA for expiration report
A.On z/OS®, use the MQRO_*_WITH_DATA values instead of the MQRO_*_WITH_FULL_DATA values.
- Combine the
Reportfield withAusing the bitwise AND operation; call the resultB. - Test
Bfor equality with each value that is possible for that type of report.For example, ifAis MQRO_EXCEPTION_WITH_FULL_DATA, testBfor equality with each of the following to determine what was specified by the sender of the message:- MQRO_NONE
- MQRO_EXCEPTION
- MQRO_EXCEPTION_WITH_DATA
- MQRO_EXCEPTION_WITH_FULL_DATA
Use a similar method to test for the MQRO_PASS_MSG_ID or MQRO_PASS_CORREL_ID options; select as the value A whichever of these two constants is appropriate, and then proceed as described previously.
Using arithmetic
If the programming language does not support bit operations, perform the following steps using integer arithmetic:
- Select one of the following values, according to the type of report to be checked:
- MQRO_COA for COA report
- MQRO_COD for COD report
- MQRO_EXCEPTION for exception report
- MQRO_EXPIRATION for expiration report
A. - Divide the
Reportfield byA; call the resultB. - Divide
Bby8; call the resultC. - Multiply
Cby8and subtract fromB; call the resultD. - Multiply
DbyA; call the resultE. - Test
Efor equality with each value that is possible for that type of report.For example, ifAis MQRO_EXCEPTION, testEfor equality with each of the following to determine what was specified by the sender of the message:- MQRO_NONE
- MQRO_EXCEPTION
- MQRO_EXCEPTION_WITH_DATA
- MQRO_EXCEPTION_WITH_FULL_DATA
The following pseudocode illustrates this technique for exception report messages:
A = MQRO_EXCEPTION
B = Report/A
C = B/8
D = B - C*8
E = D*A
Use a similar method to test for the MQRO_PASS_MSG_ID or MQRO_PASS_CORREL_ID options; select as the value A whichever of these two constants is appropriate, and then proceed as described previously, but replacing the value 8 in the previous steps by the value 2.