Posted: Sun Jun 06, 2004 8:10 pm Post subject: XML to Packed decimal
Partisan
Joined: 07 Aug 2001 Posts: 386
I have to map a XML message to a COBOL copy book
The Inout XML is
<AA><BB>2004-05-31</BB><CC>2004-05-31T13:05:15</CC><DD>118.12</DD></AA>
The Copybook has 3 packed decimal fields
05 WW
10 XX PIC 9(05) COMP-3.
10 YY PIC S9(11)V99 COMP-3.
10 ZZ PIC 9(04)V9 COMP-3.
I think the esql should look like:
SET OuputRoot.MRM.WW.XX = InputRoot.XML.AA.BB...
SET OuputRoot.MRM.WW.YY = InputRoot.XML.AA.cc...
SET OuputRoot.MRM.WW.ZZ = InputRoot.XML.AA.DD...
I need the help on the InputRoot side. Do I need to cast the characters inside the XML tag ? I can not find castiing between character to packed decimal. Any suggestion ?
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
Normally, you don't need to CAST to get Packed Decimal, because you would only be trying to move numeric values into the field.
However, in your case, you are trying to put Dates and Times that contain characters other than numerics. So, you will have to use SUBSTRING to ensure that you only have the numeric characters before you SET the Output fields.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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