Code ESQL statements to access the fields of the MQCFH header (root name MQPCF).
Messages that are of PCF format (MQPCF, MQADMIN, and MQEVENT) include the MQCFH header. You can process the contents of the MQCFH header, accessing parameters, parameter lists, strings, and groups.
You can implement your own ParameterCount field with a specific value, but this value will be overwritten by the actual number of parameters on the flow exit.
SET OutputRoot.MQPCF.Parameter[nn] =
Integer parameter ID
If you access
a 64-bit parameter, use the following syntax to differentiate from
32-bit parameters:SET OutputRoot.MQPCF.Parameter64[nn] =
Integer parameter ID
For example:SET OutputRoot.MQPCF.Parameter[1] =
MQCACF_AUTH_PROFILE_NAME;
SET OutputRoot.MQPCF.ParameterList64[nn] =
Integer parameter ID
SET OutputRoot.MQPCF.ParameterList64[nn].*[xx] =
Integer parameter values
For example:SET OutputRoot.MQPCF.ParameterList[1] =
MQIACF_AUTH_ADD_AUTHS;
SET OutputRoot.MQPCF.ParameterList[1].*[1] =
MQAUTH_SET;
SET OutputRoot.MQPCF.ParameterList[1].*[2] =
MQAUTH_SET_ALL_CONTEXT;
SET OutputRoot.MQPCF.Parameter[nn] =
Integer parameter ID
SET OutputRoot.MQPCF.Parameter[nn].* =
Integer, String or ByteArray Parameter value
SET OutputRoot.MQPCF.Group[xx] =
Group Parameter ID
For example:SET OutputRoot.MQPCF.Group[1] =
MQGACF_Q_ACCOUNTING_DATA;
SET OutputRoot.MQPCF.Group[1].Parameter[1] =
MQCA_CREATION_DATE;
SET OutputRoot.MQPCF.Group[1].Parameter[1].* =
'2007-02-05';
You can also use nested groups; for example;SET OutputRoot.MQPCF.Group[1].Group[1] =
MQGACF_Q_ACCOUNTING_DATA;
SET OutputRoot.MQPCF.Group[1].Group[1].Parameter[1] =
MQCA_CREATION_DATE;
SET OutputRoot.MQPCF.Group[1].Group[1].Parameter[1].* =
'2007-02-05';
SET OutputRoot.MQPCF.Filter[xx] =
Integer parameter ID
SET OutputRoot.MQPCF.Filter[xx].Operator =
Integer Filter name
SET OutputRoot.MQPCF.Filter[xx].Value =
Byte, Integer or String Filter Value
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQADMIN'
NAME 'MQPCF';
CREATE FIELD OutputRoot.MQPCF;
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.ReplyToQ = 'REPLYQ';
DECLARE refRequest REFERENCE TO OutputRoot.MQPCF;
SET refRequest.Type = 16; --MQCFT_COMMAND_XR z/OS
SET refRequest.StrucLength = MQCFH_STRUC_LENGTH;
SET refRequest.Version = 3; -- required for z/OS
SET refRequest.Command = MQCMD_INQUIRE_Q;
SET refRequest.MsgSeqNumber = 1;
SET refRequest.Control = MQCFC_LAST;
/* First parameter: Queue Name. */
SET refRequest.Parameter[1] = MQCA_Q_NAME;
SET refRequest.Parameter[1].* = 'QUEUENAME.*';
SET refRequest.ParameterList[1] = MQIACF_Q_ATTRS;
SET refRequest.ParameterList[1].* = MQIACF_ALL;