With a little undocumented hint, this is pretty easy.

Below is some sample code to display the message properties from a message handle.

for(iMP=0 ; ; iMP++) {    MQINQMP(hconn, /* connection handle               */ 	hMsg,     /* message handle */ 	&impo,    /* inquire message property options*/ 	&inqnames, /* iterate over all properties     */ 	&pd,       /* property descriptor             */ 	&type,    /* property data type              */ 	sizeof(value) - 1, /* length of value buffer */ 	value	  /* buffer for returned valued      */ 	&datalen, /* value length                    */ 	&CompCode, /* completion code                 */ 	&Reason); /* reason code                     */   if (CompCode != MQCC_FAILED) {      /* print the property name & value  */      name[impo.ReturnedName.VSLength] = '\0';      printf("Name=%s", name);      .. process the value...     }  if (Reason == MQRC_PROPERTY_NOT_AVAILABLE) 			break;  impo.Options |= MQIMPO_INQ_NEXT; /* iterate over the properties      */ 		 } // for(iMP=0;iMQ++) 

Where inqname can be a CHARV string such as "%", or like "usr.%". You need to decide what prefix you want to use.

The field name is returned in impo.

The value can be one of several types, for example, a character string, an integer, a 64 bit integer etc, so you need to use the returned "type" value to process it.

If impo.Options does not have MQIMPO_INQ_NEXT set, the request chains down the list of message properties from the start until if finds the first one matching the inqnames value.

To find the next property, you just have to set impo.Options |= MQIMPO_INQ_NEXT. The queue manager knows the last one that was returned to you. It starts there and continues down the chain looking for a property that is consistent with the inqnames value.

You do not need to change the inqnames value nor the impo; just the impo.Options |= MQIMPO_INQ_NEXT and loop.

Easy once you know.