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 

Minimize Getmains

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


Joined: 03 Oct 2005
Posts: 70
Topics: 34

PostPosted: Mon May 03, 2010 5:51 am    Post subject: Minimize Getmains Reply with quote

Hi All,

We have MQ triggering the application program-1 when the first message comes on to the MQ. This program-1 calls program-2. We are using external copybooks to pass the MQ data from program-1 to program-2. The MQ data can be upto 4Meg in length. What is happening here is, not all the records will be 4Meg but we are reserving 4M space. CICS folks told us that we need to do some fix to minimize the getmains.
My idea is to define external Copybook like this:
01 External-Header
05 Input-MQ-Msg Occurs 1 to 4M depending on A-record-length
10 Input-byte-record Pic X(1)

While performing MQ-Get,
Move 4M to BufferLength.
MQGET (Hconn, Hobj, MsgDesc, GetMsgOpts, BufferLength,
Buffer, A-record-length, CompCode, Reason)

Does this command use only required amount of bytes in external copybook..?

Thanks!!
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon May 03, 2010 7:07 am    Post subject: Reply with quote

BufferLength defines the buffer size.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Mon May 03, 2010 11:06 am    Post subject: Reply with quote

We had a "similar" requirement and solved it by opening the MQ twice. In the first open, we open the MQ in browse mode and MQGET the message into a short ( 2K ) data area ( just large enough to hold the XML-Header information plus some application header info ) with the MQGMO_BROWSE_FIRST/MQGMO_BROWSE_NEXT and MQGMO_ACCEPT_TRUNCATED_MSG options. By using the BROWSE_FIRST/NEXT option, the message will NOT be deleted from the MQ. After the non-destructive MQGET, we save the value returned in MQMD_MSGID and use the value returned in the specified DataLength field ( rounded up to the next higher 4K boundary ) to GETMAIN enough storage for the WHOLE message. Of course, that means we have to establish addressability to the Getmain'd buffer and define its storage area in the Linkage-Section before it can be referenced. The MQ is then opened a second time and, after storing the saved MQMD_MSGID into the MQMD_CORRELID, a second MQGET is issued with the MQGMO-MATCHOPTIONS set to include MQMO-MATCH-CORREL-ID.
Naturally, GETMAIN's should be matched with FREEMAIN's when you are finished with the buffers. Likewise MQCLOSE's to match MQOPEN's, etc.
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
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