|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
GET converts EBCDIC to ASCII? |
« View previous topic :: View next topic » |
Author |
Message
|
bruce2359 |
Posted: Wed Oct 10, 2012 8:12 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
IMS, COBOL doesn't support dynamically adjusting sizes on constants. And, yes, initializing the buffer is not required IF your app is well-written.
The buffer should be large enough to hold the largest message your apps can imagine. If the buffer is too small the get fails AND the actual msg length is returned to your app. This is documented in the APR and APG manuals. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Oct 10, 2012 1:50 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
sumithar wrote: |
Yes, this is the full sequence.
Code: |
2000-PROCESS-QUEUE-MESSAGES.
-----------------------------*
INITIALIZE WS-RRBF362-LAYOUT.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID. |
|
The application should re-initialize the entire MQMD header, including the CCSID, before every call to MQGET, especially after a failed conversion. |
|
Back to top |
|
 |
sumithar |
Posted: Thu Oct 11, 2012 12:47 pm Post subject: |
|
|
Apprentice
Joined: 13 Jun 2008 Posts: 47
|
rekarm01 wrote: |
sumithar wrote: |
Yes, this is the full sequence.
Code: |
2000-PROCESS-QUEUE-MESSAGES.
-----------------------------*
INITIALIZE WS-RRBF362-LAYOUT.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID. |
|
The application should re-initialize the entire MQMD header, including the CCSID, before every call to MQGET, especially after a failed conversion. |
I'm a bit confused
Do I need to initialise all these variables? or only some of them?
Code: |
** 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.
** Numeric encoding of message data
15 MQMD-ENCODING PIC S9(9) BINARY VALUE 785.
** Character set identifier of message data
15 MQMD-CODEDCHARSETID PIC S9(9) BINARY VALUE 0.
** Format name of message data
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.
** Ver:1 **
|
|
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Oct 11, 2012 2:23 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Some mqmd fields are input to the qmgr.
After an mqget, the MQMD will have the values from the inbound message.
So, in answer to your question: it depends. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
sumithar |
Posted: Fri Oct 12, 2012 7:58 am Post subject: |
|
|
Apprentice
Joined: 13 Jun 2008 Posts: 47
|
bruce2359 wrote: |
Some mqmd fields are input to the qmgr.
After an mqget, the MQMD will have the values from the inbound message.
So, in answer to your question: it depends. |
I can initialise just MQMD-CODEDCHARSETID and it works for all subsequent messages after the one that got a length error, but that particular message still won't be converted.
So
a)FWIW I have opened a PMR with IBM
b) I use a large buffer length to avoid getting the length error!
Thanks all |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Oct 12, 2012 9:58 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
sumithar wrote: |
bruce2359 wrote: |
Some mqmd fields are input to the qmgr.
After an mqget, the MQMD will have the values from the inbound message.
So, in answer to your question: it depends. |
I can initialise just MQMD-CODEDCHARSETID and it works for all subsequent messages after the one that got a length error, but that particular message still won't be converted.
So
a)FWIW I have opened a PMR with IBM
b) I use a large buffer length to avoid getting the length error!
Thanks all |
It works? What works? Please be specific. You are being asked technical questions. Please provide technical answers.
Before the mqget, you initialize MQMD_CCSID to what value? What is the value after the mqget?
Are you saying that your mqget succeeds? With rc=0/cc=0? The message arrives successfully in the destination queue? You run amqsbcgc, and the message is successfully converted? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
sumithar |
Posted: Fri Oct 12, 2012 10:15 am Post subject: |
|
|
Apprentice
Joined: 13 Jun 2008 Posts: 47
|
It works means, that the MQGET returned RC/CC = 0/0 and that the message was successfully converted to EBCDIC.
I forgot that I'm talking to a non-COBOL audience!
In COBOL initialize means set to whatever is default value for that variable type. In this case zeroes.
AFter the MQGET the value is 500 for MQMD-CODEDCHARSETID if, as I have explained earlier, there is no length error. If there is, then it is 819 (the value of the CCSID when the message was PUT in the queue)
I just write the message into an output file after I GET it. Not sure about "You run amqsbcgc"...I don't run anything.
Thanks! |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Oct 12, 2012 4:16 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
sumithar wrote: |
I forgot that I'm talking to a non-COBOL audience!
|
Many of us are COBOL and non-COBOL, and understand 'initialize.' For the MQGET call, the MQMD is both INPUT (to the qmgr) and OUTPUT from the qmgr. Initializing or changing some fields impacts how the MQGET behaves. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
cicsprog |
Posted: Tue Oct 16, 2012 8:40 am Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
Some good advice given here. You should also take a look at
'highlevel.SCSQCOBS' (dataset that is part of the install for ZOS MQ)
There are many examples of cobol code in this dataset for issues you have brought up in this thread.
examples
ADD MQGMO-ACCEPT-TRUNCATED-MSG TO MQGMO-OPTIONS
MOVE SPACES TO M00-MESSAGE.
MOVE SPACES TO MQMD-REPLYTOQ.
MOVE SPACES TO MQMD-REPLYTOQMGR.
etc |
|
Back to top |
|
 |
sumithar |
Posted: Thu Oct 25, 2012 4:43 am Post subject: |
|
|
Apprentice
Joined: 13 Jun 2008 Posts: 47
|
Just wanted to wrap this up. I've got some very good information in this thread, so thank you all for being patient with me. I'll take a good look at sample programs in SCSQCOBS.
I did contact IBM and they said basically it's behaving as expected.
www-01.ibm.com/support/docview.wss?uid=swg21167205 |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|