Author |
Message
|
jsanchose |
Posted: Wed Apr 26, 2006 6:42 am Post subject: Setting de Message_Id in ESQL |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
Hi,
I'm working with Message Brokers.
Could someone please explain how can I set the value of Message_Id in MQMD from a character field.
The type of Message_Id is Hexadecimal.
What type of CAST I need?
Also, to clarify:
If myField = 'IDENT' --> Message_Id would be X'4944454E54'.
Thanks,
Pepe |
|
Back to top |
|
 |
madi |
Posted: Wed Apr 26, 2006 7:03 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
I dont think I understand the question, why do u need a cast to set MessaageId
SET OutputRoot.MQMD.MessageId = 'whatever';
--madi |
|
Back to top |
|
 |
jsanchose |
Posted: Wed Apr 26, 2006 8:12 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
When I assign the value as you say I obtain an exception in node MQOutput.
"Text wrong type exception".
Catalog BIPv500
Severity 3
Number 2328
CHARACTER <--> BLOB
A BLOB is expected but a CHARACTER is received. I Think. |
|
Back to top |
|
 |
madi |
Posted: Wed Apr 26, 2006 8:55 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
can u post ur code??
--madi |
|
Back to top |
|
 |
jsanchose |
Posted: Wed Apr 26, 2006 9:13 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
Of course.
...
CREATE FIELD OutputRoot.MRM.FIN.TEXT_BLOCK.MT103;
DECLARE Swf REFERENCE TO OutputRoot.MRM.FIN.TEXT_BLOCK.MT103;
DECLARE I INTEGER;
-- Campo 20 Obligatorio - Sender's Reference
SET Swf.SW20 = InputBody.EAIWFIJ1.EAIFIJ_REF_MENSAJE;
SET OutputRoot.MQMD.MsgId = Swf.SW20;
... |
|
Back to top |
|
 |
Vijji |
Posted: Wed Apr 26, 2006 9:48 am Post subject: |
|
|
 Voyager
Joined: 30 Aug 2005 Posts: 83
|
Hi jsanchose,
I was tried this like what madi said previously.I didn't get any error.
r u using xml messageset r what?
Cheers,
vijji. |
|
Back to top |
|
 |
jsanchose |
Posted: Wed Apr 26, 2006 10:03 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
Here the MessageSet and other porperties.
...
SET OutputRoot.Properties.MessageSet = 'HV0TGUO002001';
SET OutputRoot.Properties.MessageType = 'SwiftEnvelope';
SET OutputRoot.Properties.MessageFormat = 'SWIFT';
...
But have the MQMD type fields dependences to MessageSet?
Thanks for ur interest!. |
|
Back to top |
|
 |
madi |
Posted: Wed Apr 26, 2006 10:04 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
i think you read atleast some documentation before posting here!!
Quote: |
CREATE FIELD OutputRoot.MRM.FIN.TEXT_BLOCK.MT103;
DECLARE Swf REFERENCE TO OutputRoot.MRM.FIN.TEXT_BLOCK.MT103;
DECLARE I INTEGER;
-- Campo 20 Obligatorio - Sender's Reference
SET Swf.SW20 = InputBody.EAIWFIJ1.EAIFIJ_REF_MENSAJE;
SET OutputRoot.MQMD.MsgId = Swf.SW20; |
Code: |
CREATE FIELD OutputRoot.MRM.FIN.TEXT_BLOCK.MT103;
DECLARE Swf REFERENCE TO OutputRoot.MRM.FIN.TEXT_BLOCK.MT103;
DECLARE I INTEGER;
-- Campo 20 Obligatorio - Sender's Reference
SET Swf.SW20 = FIELDVALUE(InputBody.EAIWFIJ1.EAIFIJ_REF_MENSAJE);
SET OutputRoot.MQMD.MsgId = FIELDVALUE(Swf.SW20);
|
Dont expect anyone to help with such basic stuff!!
--madi |
|
Back to top |
|
 |
jsanchose |
Posted: Wed Apr 26, 2006 11:45 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
Sorry, I was tried this like what madi said previously.I have obtained the same error, maybe a basic stuff for many people but it's a hard problem for me.
Can you help me again?
Best regards. |
|
Back to top |
|
 |
madi |
Posted: Wed Apr 26, 2006 12:25 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
post your input message for a better idea
--madi |
|
Back to top |
|
 |
jsanchose |
Posted: Wed Apr 26, 2006 12:58 pm Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
That's the question.
With this sentence:
SET OutputRoot.MQMD.MsgId = X'C5C1C96DE3D9C66DD96DD4E3F2F0F2000000000000000000';
The flow run OK.
With this other:
SET OutputRoot.MQMD.MsgId = 'EAI_TRF_R_MT202 ';
The flow ends with exception.
How can I CAST a CHARACTER STRING to an HEXADECIMAL STRING.
I'm sure that it must be easy, but I don't know the answer.
Thanks, tomorow I will read ur reply. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 26, 2006 1:30 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jsanchose wrote: |
How can I CAST a CHARACTER STRING to an HEXADECIMAL STRING. |
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak04860_.htm
Have you considered getting training on this product?
It's not a "HEXADECIMAL STRING", it is as you previously said a "BLOB".
It should have taken you less than an hour to find the answer you needed in the Information Center on your own, if you hadn't been waiting for someone else to tell you.
Even if your English is very bad, and reading it is difficult, it still should have taken you less than an hour to find the answer! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Thu Apr 27, 2006 11:41 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
jsanchose |
Posted: Thu Apr 27, 2006 12:56 pm Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
I'm happy.
At end that's the solution:
...
DECLARE WMSGID BLOB;
SET WMSGID = CAST(Swf.SW20 AS BLOB CCSID 850);
SET OutputRoot.MQMD.MsgId = WMSGID || REPLICATE(X'00',24 - LENGTH(WMSGID));
...
Thanks JT. |
|
Back to top |
|
 |
|