DATLEN (10-digit signed integer) - output
Length of the message.
This is the length in bytes of the application data in the message. If this is greater than BUFLEN, only BUFLEN bytes are returned in the BUFFER parameter (that is, the message is truncated). If the value is zero, it means that the message contains no application data.
If BUFLEN is less than the message length, DATLEN is still filled in by the queue manager, whether or not GMATM is specified on the GMO parameter (see the GMOPT field described in MQGMO - Get-message options for more information). This allows the application to determine the size of the buffer required to accommodate the message data, and then reissue the call with a buffer of the appropriate size.
However, if the GMCONV option is specified, and the converted message data is too long to fit in BUFFER, the value returned for DATLEN is:
- The length of the unconverted data, for queue manager defined formats.
In this case, if the nature of the data causes it to expand during conversion, the application must allocate a buffer somewhat bigger than the value returned by the queue manager for DATLEN.
- The value returned by the data-conversion exit, for application-defined formats.