Author |
Message
|
mqmaniac |
Posted: Fri Oct 20, 2006 8:29 am Post subject: Invalid Cobol Data in the Message |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
Hello Everyone,..
I am trying to convert cobol message to XML and creted a Mesage Set in the process.
One of the Field in the cobol Message has Invalid charactes..The Broker debugger does not dispay these characters .
I tried comparing the characters with a variable X'00' and No Use.
The Output XML is failing on SAX PArser due to these characters.
BUT,When i browse the message using RFHUTIL..I see the characters as
<payePyblNm>..............................</payePyblNm>
The HEX values are 00.
Can someone pls tell me How to handle the Invalid Characters inside Cobol data.Pls Help. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 20, 2006 8:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Get the mainframe program to change the field to be filled with SPACES. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mqmaniac |
Posted: Fri Oct 20, 2006 9:17 am Post subject: |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
Thanks for the prompt Reply,...
BUT,..In my scenaro thats a huge task to change the mainframe program,..and I want to try everuything out before.
I thhought Message Broker has a way to handle Invalid Characters.
Is there any documentation/Logic to help? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 20, 2006 9:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, you can do a number of things inside Broker to handle all kinds of characters, including the X'00' character that is not valid in XML data.
For example, you could adjust your message set to treat these as NULL values. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mqmaniac |
Posted: Thu Oct 26, 2006 9:27 am Post subject: |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
Thanks for the Reply Jeff...
When you said " handle all kinds of characters including the X'00' character that is not valid in XML data"
This is what I tried the following to find the NULL characters in the input ,
DECLARE C CHARACTER;
SET C =X'00';
IF(SUBSTRING(CAST("InputBody"."D115_ADD_ADDRESS" AS CHAR )FROM 1 FOR 1)= "C" ) THEN
SET OutXmlRef."payeCollctrGrp"."payePyblNm1"= "INVALID Characters";
END IF;
I was trying to Compare X'00' in the input field.
Did I miss anything?
But the above code Never worked.
WMQI is unable to compare two NULL Characters?
How do I Find NULL characters in Cobol Data If they are scattered throughout the File?My reqiurement is to find them and replace them with Spaces.
Pls guide me on How to handle these Invalid Chars/NULLs in Cobol Data?
Let me Rephrase what we plan ,..
Whenever we encounter a NULL or INVALID XML Data in the Cobol Field,..we plan to replace it with Spaces,So that the length of the XML Data becomes Zero.
Can you pls tell me the Lenght of 30 Spaces =?
Lenght of 30 NULLs =?
Its getting me confused...!!!! |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 26, 2006 2:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Look up the import function for the cobol copy book. In V6 the last tab allows you to default a number of values per field (like treat spaces as null value etc...)
You'll have to check if this works for 2.1 though...
In this case your tree value would be NULL.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqmaniac |
Posted: Thu Oct 26, 2006 3:59 pm Post subject: |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
Quote: |
the last tab allows you to default a number of values per field (like treat spaces as null value etc...)
|
The Encoding Null I selected was NULLLogicalValue and I did not put in any value in Encoding Null Value..
How do I replace NULL's with SPACES in the input,.. using this Property.
Pls help! |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 26, 2006 5:31 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You are talking about the message set here.
I am talking about the message definition file.
The null value can be defined as spaces, as hex 00 etc....
In order to see the different choices you have to reimport the cobol copy book. Use the wizzard. (I use broker V6 and toolkit V6) I believe you can use toolkit V6 with mqsi 2.1...
The standard null in xml looks like
<mynulltag/> or <othernulltag></othernulltag>
The null value you were talking about on the message set tag will determine (among other things) whether in xml you would add the xsi:nil=true attribute to a nulltag when serializing under MRM:
<mynulltag xsi:nil=1 />
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|