MQ

 View Only
  • 1.  How do I get the size of a message property

    IBM Champion
    Posted Tue May 10, 2022 07:38 AM
    I've been struggling to get the size of a message property using MQINQMP

    I preset the datalength field to -3
    I use MQINQMP
    If my valuelength is 64, and the message property is of length 20  I get datalength of 20.  Which is what I expect.  It works.

    If my valuelength is 64, and the message property is of length 100, I get reason 2469: FAILED: MQRC_PROPERTY_VALUE_TOO_BIG
    and the datalength is not set ( it stays at -3).

    How do I get the length of the property, so I can allocate a buffer of the right size.    Is there a setting I need to use?

    I'm on z/OS in a 64 bit C program.
    The supplied sample CSQ4BCG1 works, but that's a 31 big program.

    Colin

    ------------------------------
    Colin Paice
    ------------------------------


  • 2.  RE: How do I get the size of a message property

    Posted Tue May 10, 2022 08:21 AM
    Edited by Mark Taylor Tue May 10, 2022 08:23 AM
    Look at amqssbxa.c as one example. It has a default size, but if it gets TOO_BIG return code, it loops reallocating the buffer size using ReturnedName.VSLength until it succeeds.

    That sample is on Distributed, but there might be a similar z/OS one - it would have to do the same technique.

    ------------------------------
    Mark Taylor
    Winchester
    ------------------------------



  • 3.  RE: How do I get the size of a message property

    IBM Champion
    Posted Wed May 11, 2022 02:53 AM
    I used the MQ provided sample CSQ4BCG1 which works, but when I compile it to be 64 bit, it fails with the same symptoms I as  getting ( dataLength not returned).
    I'll ask to get a defect raised

    ------------------------------
    Colin Paice
    ------------------------------



  • 4.  RE: How do I get the size of a message property

    IBM Champion
    Posted Thu May 12, 2022 06:10 AM

    I concur - seems to be a defect. I have recreated the same problem with a little sample C program I have to inquire a message property. When built 64-bit on z/OS, you don't get either of the lengths back when you get MQRC_PROPERTY_VALUE_TOO_BIG.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------