View previous topic :: View next topic |
Author |
Message |
Jeba Beginner
Joined: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
|
Posted: Mon Apr 12, 2004 5:04 pm Post subject: Handling bigger message in MQ using CICS |
|
|
Hi,
I am working on a CICS application which used to read the messages from the external vendors and process them. Sometimes some vendor is sending a message with larger length ( > 16777215 ) greater than COBOL definition. So MQ GET command is failing to read the messages (i.e, the message is getting truncated ).
It looks like Java can be able to read and write such messages in a queue. Is there anyway it can be done using CICS or COBOL ( I don't want to post the same question in COBOL as well as CICS forum).
Please let me know if anyone have any solution for this. _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean) |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Apr 12, 2004 9:55 pm Post subject: |
|
|
Jeba,
You need to change the MAXMSGL on both the Queue Manager and Queue. MAXMSGL is the maximum length of messages allowed on queues for this queue manager. This is in the range 32 KB through 100 MB. The default is 4 MB (4 194 403 bytes). The length you mentioned is close to 16 MB. so you can increase the max message length to 16 mb.
You can alter the maxmsgl by using runmqsc:
Code: |
alter q(MY.QUEUE) maxmsgl(new_length)
|
You may have to alter it on the qmgr as well:
Code: |
alter qmgr maxmsgl(new_length)
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Jeba Beginner
Joined: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
|
Posted: Wed Apr 14, 2004 11:38 am Post subject: |
|
|
Kolusu,
The Queue manager and queue were already defined with maximum message length of 104857600. Since the maximum definition of a variable in COBOL is 16777215 ( am getting compiler error if I define more than this ) and the message is greater than 16777215 in MQ, I am getting 'Message truncated' error message from MQ. _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean) |
|
Back to top |
|
|
bob_buxton Beginner
Joined: 20 Dec 2002 Posts: 44 Topics: 0 Location: Hampshire, England
|
Posted: Thu Apr 15, 2004 4:21 am Post subject: |
|
|
You can Get and Put large messages in CICS by GETMAINing a large buffer and passing the address and size of the buffer on MQGET/MQPUT. A common technique is to intially get a buffer based on a guess of the largest message you are likely to receive and if you do get a larger message Freemain the existing buffer and Getmain a larger one based on the actual message size returned on the failed MQGET.
Once you have got the message into storage you then have to process the message content and since it is larger than the maximum variable size you will need to use smaller structures to map the subcomponents of the message and pointers to set the addressing. _________________ Bob Buxton
Ex Websphere MQ for zOS development |
|
Back to top |
|
|
Jeba Beginner
Joined: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
|
Posted: Thu Apr 15, 2004 10:20 am Post subject: |
|
|
Bob,
Thanks a lot. Do you have any idea about doing the same in Batch COBOL program. _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean) |
|
Back to top |
|
|
bob_buxton Beginner
Joined: 20 Dec 2002 Posts: 44 Topics: 0 Location: Hampshire, England
|
Posted: Fri Apr 16, 2004 3:24 am Post subject: |
|
|
In principal it is exactly the same except that I am not sufficiently familiar with Batch COBOL to know how you dynamically allocate/free storage in that environment. Perhaps there is a callable Language Environment service.
I am sure one of the Cobol experts on the fourum will know. _________________ Bob Buxton
Ex Websphere MQ for zOS development |
|
Back to top |
|
|
Jeba Beginner
Joined: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
|
Posted: Mon Apr 19, 2004 5:08 pm Post subject: |
|
|
Bob,
Thanks for the info.
COBOL experts,
Please let me know if anyone have any solution for the above issue. _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean) |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Jeba Beginner
Joined: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
|
Posted: Wed Apr 21, 2004 8:44 am Post subject: |
|
|
Kolusu,
Thanks a lot for the information. Will try to use the commands suggested by you in our application. _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean) |
|
Back to top |
|
|
|
|