Question

Hopefully someone can help with this as I can't seem to find the answer elsewhere.

I'm writing a COBOL routine to PUT and GET messages to an MQ queue.

The messages in question are all contained in a single file and I would like to know if the syntax of MQPUT can be used to just PUT the file or do I have to read the file and do a PUT of each individual message?

Was it helpful?

Solution

The syntax of MQPUT API says that the message to be put is passed as buffer. The application must fill the buffer with data to be put. So you can either read the entire file to a sufficiently sized buffer and send it or read one record at a time from the file and send it. It depends on how your receiving application wants the message format to be. Can it process the whole file as one message or one record at a time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top