Author |
Message
|
masteringmq |
Posted: Fri Apr 17, 2009 12:12 am Post subject: How to output non-XML data for a mainframe application |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
The code below is to manipulate the XML message and send it as a blob. However after including the destination list, it does not send a blob message that I have manipulated, instead it send out the original xml message as the output. How to I solve the problem?
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- call CopyEntireMessage();
-- SET OutputRoot.XML.IFX.SignonRs = InputRoot.XML.IFX.SignonRs.ClientApp.Org;
DECLARE Field1 CHAR;
DECLARE Field2 CHAR;
DECLARE Field3 CHAR;
DECLARE Field4 CHAR;
DECLARE Field5 CHAR;
DECLARE Field6 CHAR;
SET Field1 = 'OrgName:' || InputRoot.XML.IFX.SignonRs.ClientApp.Org;
SET Field2 = '!CustName:' || InputRoot.XML.IFX.SignonRs.ClientApp.Name;
SET Field3 = '!Country:' || InputRoot.XML.IFX.SignonRs.ClientApp.SCB_Country;
SET Field4 = '!TransactionDate:' || CAST(EXTRACT(DAY FROM CAST(InputRoot.XML.IFX.SignonRs.ServerDt AS DATE)) AS CHAR) || '-' || CAST(EXTRACT(MONTH FROM CAST(InputRoot.XML.IFX.SignonRs.ServerDt AS DATE)) AS CHAR) || '-' || CAST(EXTRACT(YEAR FROM CAST(InputRoot.XML.IFX.SignonRs.ServerDt AS DATE)) AS CHAR); --EXTRACT(YEAR FROM InputRoot.XML.IFX.SignonRs.ServerDt); --InputRoot.XML.IFX.SignonRs.ServerDt;
SET Field5 = '!AccountNum:' || InputRoot.XML.IFX.BankSvcRq.AcctInq.AcctID;
SET Field6 = '!AcctType:' || InputRoot.XML.IFX.BankSvcRq.AcctInq.AcctType;
IF POSITION('Current' IN InputRoot.XML.IFX.BankSvcRq.AcctInq.AcctType) > 0 THEN
SET Field6 = '!AcctType:' || REPLACE(InputRoot.XML.IFX.BankSvcRq.AcctInq.AcctType,'Current','CheckINAccount');
SET OutputLocalEnvironment.Destination.MQ.DestinationData.queueName = 'FIX.OUTQ1';
ELSE
SET Field6 = '!AcctType:' || REPLACE(InputRoot.XML.IFX.BankSvcRq.AcctInq.AcctType,'Savings','SavingsAccount');
SET OutputLocalEnvironment.Destination.MQ.DestinationData.queueName = 'FIX.OUTQ2';
END IF;
SET OutputRoot.BLOB.BLOB = CAST((Field1 || Field2 || Field3 || Field4 || Field5 || Field6) AS BLOB CCSID OutputRoot.MQMD.CodedCharSetId);
-- SET OutputRoot.XML.IFX.SignonRs = InputRoot.XML.IFX.SignonRs.ServerDt;
RETURN TRUE;
END; |
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 17, 2009 12:18 am Post subject: Re: Destination List |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
masteringmq wrote: |
The code below is to manipulate the XML message and send it as a blob. |
Please explain:
- the difference between a BLOB and an XML document in terms of WMQ message content
- why you're using the depreciated XML domain _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 17, 2009 1:35 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Please review the documentation on the properties that you have set on the Compute node that hosts this ESQL. |
|
Back to top |
|
 |
masteringmq |
Posted: Fri Apr 17, 2009 7:38 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
I found the solution. The reason for using the XML is because the application developer decides to send XML based messages. But the receiver is a mainframe, therefore im converting it to a BLOB message. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 17, 2009 7:42 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
masteringmq wrote: |
I found the solution. The reason for using the XML is because the application developer decides to send XML based messages. But the receiver is a mainframe, therefore im converting it to a BLOB message. |
The XML domain is the wrong choice for XML messages.
And building the "BLOB" message by hand the way you are is the wrong thing to do as well. |
|
Back to top |
|
 |
masteringmq |
Posted: Sat Apr 18, 2009 8:19 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
what is the best way to rebuild a message?. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Sat Apr 18, 2009 8:27 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
You could model it using a message set.
You might want to look at the TDS layer to model the outbound message |
|
Back to top |
|
 |
Vitor |
Posted: Sat Apr 18, 2009 10:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
masteringmq wrote: |
But the receiver is a mainframe, therefore im converting it to a BLOB message. |
Why? It'll still be in the wrong format. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Apr 18, 2009 11:22 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
masteringmq |
Posted: Sat Apr 18, 2009 9:39 pm Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
Well this is just the fundamentals. If I were to create a message set then I need a copybook provided by the mainframe team. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Apr 19, 2009 12:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Changed topic name as suggested by kimbert _________________ MQ & Broker admin |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Sun Apr 19, 2009 3:52 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
masteringmq wrote: |
Well this is just the fundamentals. If I were to create a message set then I need a copybook provided by the mainframe team. |
Not true, but it helps!
How are they modelling the data you send them, this must be formalised somewhere..... |
|
Back to top |
|
 |
Vitor |
Posted: Sun Apr 19, 2009 8:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
masteringmq wrote: |
If I were to create a message set then I need a copybook provided by the mainframe team. |
No you don't  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|