Author |
Message
|
rgappan |
Posted: Tue Oct 24, 2006 4:54 pm Post subject: Spaces at the end of record while MQPUT |
|
|
Newbie
Joined: 24 Oct 2006 Posts: 2
|
Hi,
Can anyone help.We use a cobol code to put the data to MQ.when we put the data we put the whole data in fixed record length of 80 bytes as each record .what happens is the last record is sometimes less than 80 for example 60 but we are putting 80 in mqput and the last 20 bytes is going as hex '40' for which the receiving party is facing problems with the spaces.
Is their an option to eliminate this while MQPUT.I am new to this form.I did not search the old topics pls excuse if already avaliable it was urgent so I posted it.
The MQPUT option we use are
CALL 'MQPUT' USING W03-HCONN
W03-HOBJ
MQMD
MQPMO
MSGLENGTH
MSGBUFFER
W03-COMPCODE
W03-REASON. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 24, 2006 7:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
In your message set you can tell the broker to treat spaces as null values.
I believe it is on the third or forth (last) screen when you import the copybook.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 24, 2006 11:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
What is MSGLENGTH set to on the put? The length of the message (60 bytes) or the length of the buffer (80 bytes)? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Oct 25, 2006 4:30 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Quote: |
what happens is the last record is sometimes less than 80 for example 60 but we are putting 80 in mqput |
Then set the message length in the MQPUT to the ACTUAL message length and not the length of the buffer.
This stuff is pretty well covered in the Application Programming Reference if you need details. |
|
Back to top |
|
 |
rgappan |
Posted: Wed Oct 25, 2006 5:16 am Post subject: |
|
|
Newbie
Joined: 24 Oct 2006 Posts: 2
|
Thank you for respoinding
01 MSGBUFFER.
02 DOC-DATA OCCURS 45000 TIMES PIC X(80).
But while writing we are writing with respect msglength
MOVE END-OF-MSG TO MSGLENGTH.
MOVE MQPER-PERSISTENT TO MQMD-PERSISTENCE.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID.
Not as a block .
appreciate your help.
Itried pasting the data here but it is cmming zig zag
Assming each record to be 80 bytes it looks as below
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
when the data is recieved at the customer end it goes as spaces padded at the end of last record till 80 byte |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 25, 2006 5:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Alright, let me rephrase my question - is END-OF-MSG the actual value of bytes written or 45000*80? It sounds like the latter to me!
As kevinf2349 correctly points out and I alluded to, it should be set to the actual value of the data as per the Application Programming Reference. What you're sending is the full buffer which I imagine is initialised to spaces elsewhere in your code.
Functioning as desiged - RTFM  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|