MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Handling bigger message in MQ using CICS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
Jeba
Beginner


Joined: 02 Dec 2002
Posts: 48
Topics: 9
Location: Columbus, GA

PostPosted: Mon Apr 12, 2004 5:04 pm    Post subject: Handling bigger message in MQ using CICS Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Apr 12, 2004 9:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Jeba
Beginner


Joined: 02 Dec 2002
Posts: 48
Topics: 9
Location: Columbus, GA

PostPosted: Wed Apr 14, 2004 11:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bob_buxton
Beginner


Joined: 20 Dec 2002
Posts: 44
Topics: 0
Location: Hampshire, England

PostPosted: Thu Apr 15, 2004 4:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Jeba
Beginner


Joined: 02 Dec 2002
Posts: 48
Topics: 9
Location: Columbus, GA

PostPosted: Thu Apr 15, 2004 10:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bob_buxton
Beginner


Joined: 20 Dec 2002
Posts: 44
Topics: 0
Location: Hampshire, England

PostPosted: Fri Apr 16, 2004 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Jeba
Beginner


Joined: 02 Dec 2002
Posts: 48
Topics: 9
Location: Columbus, GA

PostPosted: Mon Apr 19, 2004 5:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Apr 20, 2004 10:28 am    Post subject: Reply with quote

Jeba,

After a little bit digging I was able to find something. First allocate memory (using a language environment call CEEGTST, which is equivalent to EXEC CICS GETMAIN in cics) and set it to MQ-MESG-BUFFER-POINTER.

Then perform "SET ADDRESS OF MQ-REQ-BUFFER TO MQ-MESG-BUFFER-POINTER", where MQ-REQ-BUFFER is a character variable declared in the LINKAGE section.

Check this link for detailed explanation of language environment call CEEGTST--Get heap storage
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3130/3.5.38?DT=20020625092930

Check this link for getmain command in cics

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHJAP4C/1.102?DT=20030108162734

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jeba
Beginner


Joined: 02 Dec 2002
Posts: 48
Topics: 9
Location: Columbus, GA

PostPosted: Wed Apr 21, 2004 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group