View previous topic :: View next topic |
Author |
Message |
cxvxbx Beginner
Joined: 26 Apr 2006 Posts: 16 Topics: 8 Location: Utopia
|
Posted: Mon Jun 05, 2006 5:26 am Post subject: Copying a unique message from a MQ |
|
|
Is there any utility that allows users to copy a unique message from a MQ?
E.g. there is a MQ with over 10,000 messages. Amongst these, there is one unique message that contains a string of data |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Jun 05, 2006 6:59 am Post subject: |
|
|
cxvxbx,
Do you know the messageID of the message which contains the string 'abcdef' ? You will atleast need to the CorrelID/messageID of the message to be copied. There is a Program called "Q" which can be used to dump specific messages , but you need to know the messageId/CorrelID. CSQUTIL is used to dump all the messages.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
cxvxbx Beginner
Joined: 26 Apr 2006 Posts: 16 Topics: 8 Location: Utopia
|
Posted: Mon Jun 05, 2006 7:07 am Post subject: |
|
|
Thanks kolusu, its possible to determine the messageID or the correlID.
What function can i use to copy the message using the messageID or correlID ? |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Mon Jun 05, 2006 9:49 am Post subject: |
|
|
Kolusu,
Can we go by the concept below and make use of the variable MQMD-MSGID in the copy book for Message Descriptor Structure:
Code: |
COPY CMQMDV.
******************************************************************
** **
** IBM MQSeries for OS/390 **
** **
** COPYBOOK NAME: CMQMDV **
** **
** DESCRIPTION: Message Descriptor Structure **
** **
******************************************************************
** **
** FUNCTION: This file declares the structure MQMD, **
** which is used by the main MQI. **
** **
** PROCESSOR: COBOL **
** **
******************************************************************
** MQMD structure
10 MQMD.
** Structure identifier
15 MQMD-STRUCID PIC X(4) VALUE 'MD '.
** Structure version number
15 MQMD-VERSION PIC S9(9) BINARY VALUE 1.
** Options for report messages
15 MQMD-REPORT PIC S9(9) BINARY VALUE 0.
** Message type
15 MQMD-MSGTYPE PIC S9(9) BINARY VALUE 8.
** Message lifetime
15 MQMD-EXPIRY PIC S9(9) BINARY VALUE -1.
** Feedback or reason code
15 MQMD-FEEDBACK PIC S9(9) BINARY VALUE 0.
** Data encoding
15 MQMD-ENCODING PIC S9(9) BINARY VALUE 785.
** Coded character set identifier
15 MQMD-CODEDCHARSETID PIC S9(9) BINARY VALUE 0.
** Format name
15 MQMD-FORMAT PIC X(8) VALUE SPACES.
** Message priority
15 MQMD-PRIORITY PIC S9(9) BINARY VALUE -1.
** Message persistence
15 MQMD-PERSISTENCE PIC S9(9) BINARY VALUE 2.
** Message identifier
15 MQMD-MSGID PIC X(24) VALUE LOW-VALUES.
** Correlation identifier
15 MQMD-CORRELID PIC X(24) VALUE LOW-VALUES.
** Backout counter
15 MQMD-BACKOUTCOUNT PIC S9(9) BINARY VALUE 0.
** Name of reply queue
15 MQMD-REPLYTOQ PIC X(48) VALUE SPACES.
** Name of reply queue manager
15 MQMD-REPLYTOQMGR PIC X(48) VALUE SPACES.
** User identifier
15 MQMD-USERIDENTIFIER PIC X(12) VALUE SPACES.
** Accounting token
15 MQMD-ACCOUNTINGTOKEN PIC X(32) VALUE LOW-VALUES.
** Application data relating to identity
15 MQMD-APPLIDENTITYDATA PIC X(32) VALUE SPACES.
** Type of application that put the message
15 MQMD-PUTAPPLTYPE PIC S9(9) BINARY VALUE 0.
** Name of application that put the message
15 MQMD-PUTAPPLNAME PIC X(28) VALUE SPACES.
** Date when message was put
15 MQMD-PUTDATE PIC X(8) VALUE SPACES.
** Time when message was put
15 MQMD-PUTTIME PIC X(8) VALUE SPACES.
** Application data relating to origin
15 MQMD-APPLORIGINDATA PIC X(4) VALUE SPACES.
|
Code: |
01 MSG-TEXT PIC X(06) VALUE SPACES.
PROCEDURE DIVISION.
IF MQMD-MSGID NOT EQUAL SPACES AND MSG-TEXT = 'ABCDEF'
DISPLAY MSG-TEXT
END-IF
|
I have a query as when i try to print the variable in the spool MQMD-MSGID i do not get any unqiue identification and i get a 24 byte alphanumeric value.My understanding is that each and every message in the queue will have unique identification and we can make use of that identiifcation to solve the problem.How can i know the unique identification message id ? Please correct me if i am wrong and guide me further . _________________ Shekar
Grow Technically |
|
Back to top |
|
 |
|
|