View previous topic :: View next topic |
Author |
Message |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Thu May 03, 2007 5:27 am Post subject: 2080 MQ Error |
|
|
Hai All,
I am getting Reason code 2080 when i am trying to get a read a message from the MQ Queue and i have used the option :
Code: |
COMPUTE MQGMO-OPTIONS = MQGMO-NO-WAIT +
MQGMO-SYNCPOINT +
MQGMO-ACCEPT-TRUNCATED-MSG.
|
And i am making use of MQGET call .Moreover i am also using:
Code: |
Corrective action:
Supply a buffer that is at least as large as DataLength, or specify MQGMO_ACCEPT_TRUNCATED_MSG if not all of the message data is required. |
Which i am doing so in my Get call .Please help me how to solve this problem? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu May 03, 2007 7:33 am Post subject: |
|
|
yadav2005,
That is just a warning message. However you need to increase the buffer length. Did you do that?
If it is alright to accept truncated messages then change to this parm MQGMO_ACCEPT_TRUNCATED_MSG = yes
Hope this helps..
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu May 03, 2007 7:50 am Post subject: |
|
|
Perhaps the OPTIONS are getting changed again before the call? Can you post all code from options set to the GET? _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Thu May 03, 2007 9:13 am Post subject: |
|
|
Thanks Kolusu and Bill,
Let me explain what is my requirement:
I have a COBOL Program which reads messages one by one from the MQ Queue and does an implict deletion of the messages from the Queue and whatever the messages are read i am storing them in a file so as to make the Queue empty instead of getting fulled up and i am putting the last message only back to the Queue everytime the program is run by this way i am always having at least 1 message in the queue.The job when run for the first time it was fine and it was able to read all messages from the queue successfully and created a file with same no of deleted messages and display of how many messages deleted also was shown properly and the last message was put in the queue.
Later on with that 1 message already on queue , 10 more messages were put on the queue and the job was run again but this time it was able to read all messages and create an output file with 11 messages but before putting back the last message it got disconnected from the queue manager and Reason code is 2080 i got info through some other system in our flow of jobs.
Kolusu how can i change MQGMO_ACCEPT_TRUNCATED_MSG = yes
I am posting my code , please help me what is the problem.
Code: |
*****************************************************************
* Values Related to MQGMO Structure **
*****************************************************************
** Structure Identifier
10 MQGMO-STRUC-ID PIC X(4) VALUE 'GMO '.
** Structure Version Number
10 MQGMO-VERSION-2 PIC S9(9) BINARY VALUE 2.
10 MQGMO-VERSION-3 PIC S9(9) BINARY VALUE 3.
10 MQGMO-CURRENT-VERSION PIC S9(9) BINARY VALUE 3.
** Get-Message Options
10 MQGMO-WAIT PIC S9(9) BINARY VALUE 1.
10 MQGMO-NO-WAIT PIC S9(9) BINARY VALUE 0.
10 MQGMO-SYNCPOINT PIC S9(9) BINARY VALUE 2.
10 MQGMO-SYNCPOINT-IF-PERSISTENT PIC S9(9) BINARY VALUE 4096.
10 MQGMO-NO-SYNCPOINT PIC S9(9) BINARY VALUE 4.
10 MQGMO-MARK-SKIP-BACKOUT PIC S9(9) BINARY VALUE 128.
10 MQGMO-BROWSE-FIRST PIC S9(9) BINARY VALUE 16.
10 MQGMO-BROWSE-NEXT PIC S9(9) BINARY VALUE 32.
10 MQGMO-MSG-UNDER-CURSOR PIC S9(9) BINARY VALUE 256.
10 MQGMO-ACCEPT-TRUNCATED-MSG PIC S9(9) BINARY VALUE 64.
10 MQGMO-SET-SIGNAL PIC S9(9) BINARY VALUE 8.
10 MQGMO-FAIL-IF-QUIESCING PIC S9(9) BINARY VALUE 8192.
10 MQGMO-CONVERT PIC S9(9) BINARY VALUE 16384.
10 MQGMO-NONE PIC S9(9) BINARY VALUE 0.
|
Program code
Code: |
01 WS-COMPCODE PIC S9(9) BINARY.
01 WS-REASON PIC S9(9) BINARY.
01 WS-HCONN PIC S9(9) BINARY VALUE 0.
01 WS-HOBJ PIC S9(9) BINARY VALUE 0.
01 WS-OPENOPTIONS PIC S9(9) BINARY.
01 WS-RETURN-CODE PIC S9(4) BINARY VALUE 0.
01 WS-ERROR-MESSAGE PIC X(48) VALUE SPACES.
01 WS-MSGBUFFER.
05 WS-MSGBUFFER-ARRAY PIC X(1) OCCURS 8192 TIMES.
01 WS-MSGLENGTH PIC S9(9) BINARY VALUE 8192.
01 WS-DATALENGTH PIC S9(9) BINARY VALUE +0.
01 WS-MESSAGE PIC X(8192).
COMPUTE MQGMO-OPTIONS = MQGMO-NO-WAIT +
MQGMO-SYNCPOINT +
MQGMO-ACCEPT-TRUNCATED-MSG.
INITIALIZE WS-MSGBUFFER.
INITIALIZE WS-COMPCODE
WS-REASON.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID.
MOVE MQENC-NATIVE TO MQMD-ENCODING.
MOVE MQCCSI-Q-MGR TO MQMD-CODEDCHARSETID.
MOVE MQFMT-STRING TO MQMD-FORMAT.
MOVE MQGMO-CONVERT TO MQGMO-OPTIONS.
MOVE LENGTH OF WS-MSGBUFFER TO WS-MSGLENGTH.
CALL 'CSQBGET' USING WS-HCONN
WS-HOBJ
MQMD
MQGMO
WS-MSGLENGTH
WS-MSGBUFFER
WS-DATALENGTH
WS-COMPCODE
WS-REASON.
IF WS-COMPCODE = MQCC-OK
DO SOME PROCESSING ....
WRITE REPORT
MOVE WS-REPORT-REC TO WS-MESSAGE
ELSE
IF WS-REASON IS EQUAL TO MQRC-NO-MSG-AVAILABLE
SET EOF-MESSAGE TO TRUE
MOVE 'NO MORE MESSAGES IN THE QUEUE' TO WS-ERROR-MESSAGE
DISPLAY '*********************************************'
DISPLAY 'TOTAL MESSAGES DELETED FROM THE QUEUE: '
WS-MESSAGE-NUM
DISPLAY WS-ERROR-MESSAGE
DISPLAY '*********************************************'
DISPLAY 'WS-COMPCODE ' WS-COMPCODE
DISPLAY 'WS-REASON ' WS-REASON
PERFORM MQPUT
ELSE
MOVE 'MQGET FAILED WITH THE FOLLOWING REASONS' TO
WS-ERROR-MESSAGE
END-IF.
MQPUT.
COMPUTE MQPMO-OPTIONS = MQPMO-NO-SYNCPOINT +
MQPMO-DEFAULT-CONTEXT.
INITIALIZE WS-MSGBUFFER
WS-COMPCODE
WS-REASON.
MOVE WS-MESSAGE TO WS-MSGBUFFER.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID.
MOVE MQENC-NATIVE TO MQMD-ENCODING.
MOVE MQCCSI-Q-MGR TO MQMD-CODEDCHARSETID.
MOVE MQFMT-STRING TO MQMD-FORMAT.
MOVE LENGTH OF WS-MSGBUFFER TO WS-MSGLENGTH.
CALL 'CSQBPUT' USING WS-HCONN
WS-HOBJ
MQMD
MQPMO
WS-MSGLENGTH
WS-MSGBUFFER
WS-DATALENGTH
WS-COMPCODE
WS-REASON.
IF WS-COMPCODE = MQCC-OK
DISPLAY '*********************************************'
DISPLAY 'LAST MESSAGE WAS PUT BACK IN THE QUEUE SUCCESS '
DISPLAY '*********************************************'
DISPLAY 'WS-COMPCODE ' WS-COMPCODE
DISPLAY 'WS-REASON ' WS-REASON
DISPLAY '*********************************************'
ELSE
MOVE 'LAST MESSAGE WAS NOT PUT BACK IN THE QUEUE FAIL'
TO WS-ERROR-MESSAGE
PERFORM 999-ABEND-ERROR
END-IF.
|
JOB OUTPUT
Code: |
MQCONN SUCCESSFUL 0000
HCONN 123456789
QMNAME ABCD
MQOPEN SUCCESSFUL
*********************************************
TOTAL MESSAGES DELETED FROM THE QUEUE: 11
NO MORE MESSAGES IN THE QUEUE
*********************************************
MQDISCONNECT SUCCESSFUL
|
Now the Program does not display any statistical info about the WS-COMPCODE and WS-REASON and only gets disconnected |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu May 03, 2007 11:26 am Post subject: |
|
|
1) AFter you compute MQGMO-OPTIONS with the options you want, a different option, MQGMO-CONVERT, is MOVEd to MQGMO-OPTIONS. I expect that the MOVE nullifies the action of the COMPUTE.
2) I don't understand why you want to always put one message back on the queue? Can you explain? _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu May 03, 2007 1:00 pm Post subject: |
|
|
Mr Dennis,
as usual, you went straight to the heart of the problem. good eyes...!
yadav2005,
i would also like to know, why are you putting the last on the queue?
how about a little idea of what you are tasked with doing? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Thu May 03, 2007 9:15 pm Post subject: |
|
|
Thanks Bill and dbzTHEdinosauer,
I am purposefully putting the last message back to the Queue so that the MQ Queue is not empty at any point of time and it has at least one message and moreover i want my program to do a PUT also a message in the queue in addition to GET.
Quote: |
AFter you compute MQGMO-OPTIONS with the options you want, a different option, MQGMO-CONVERT, is MOVEd to MQGMO-OPTIONS. I expect that the MOVE nullifies the action of the COMPUTE.
|
Can you let me know how this is happening as i am not aware of this option and how can i know that this may happen ? Thanks. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri May 04, 2007 2:58 am Post subject: |
|
|
Code: |
>>>>>>>>>>>>COMPUTE MQGMO-OPTIONS = MQGMO-NO-WAIT +
MQGMO-SYNCPOINT +
MQGMO-ACCEPT-TRUNCATED-MSG.
INITIALIZE WS-MSGBUFFER.
INITIALIZE WS-COMPCODE
WS-REASON.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID.
MOVE MQENC-NATIVE TO MQMD-ENCODING.
MOVE MQCCSI-Q-MGR TO MQMD-CODEDCHARSETID.
MOVE MQFMT-STRING TO MQMD-FORMAT.
>>>>>>>>>>>>MOVE MQGMO-CONVERT TO MQGMO-OPTIONS.
MOVE LENGTH OF WS-MSGBUFFER TO WS-MSGLENGTH.
CALL 'CSQBGET' USING WS-HCONN
|
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri May 04, 2007 2:59 am Post subject: |
|
|
It is the 6th MOVE after your COMPUTE - it is in the code you posted. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri May 04, 2007 3:04 am Post subject: |
|
|
Quote: | I am purposefully putting the last message back to the Queue so that the MQ Queue is not empty at any point of time and it has at least one message and moreover i want my program to do a PUT also a message in the queue in addition to GET. |
why do you never want the queue to be empty? This means you have to allow duplicate messages. What is it that you are trying to accomplish? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
|
|