|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Handling low value and high value in COBOL copy book |
« View previous topic :: View next topic » |
Author |
Message
|
deepak_paul |
Posted: Wed Jun 09, 2010 3:04 pm Post subject: Handling low value and high value in COBOL copy book |
|
|
Centurion
Joined: 04 Oct 2008 Posts: 147 Location: US
|
Hello,
We are using WMB 6.1.0.4. This is the flow:
MQInput -> Compute -> MQOutput.
We are getting a cobol message from Mainframe that we transform to XML.
The message from the Mainframe application can have Mainframe low value x'00' or High Value x'ff' for some fields.
There is an option in Broker that when you import the copybook that you can map either SPACE or x'00' or x'ff' to NULL.
Quote: |
Create null values for all fields
If your COBOL level 01 data structure is being initialized to a particular character (for example, SPACE, LOW-VALUE, or HIGH_VALUE) in your COBOL application, you might want to select Create null values for all fields.
If the data structure is initialized to a particular character, the resultant message might cause parsing errors because some fields contain a value that is not valid for the data type of the field. If you select this option, any fields that have been initialized to a particular character are treated as NULL values, and the parsing will succeed.
Specify the initialization character using the Null character control, the default value for which is the SPACE character. Setting these controls results in the selection of the Nillable property for all global elements, the CWF Encoding Null property set to NullLiteralFill, and the CWF Encoding Null Value property set to the specified character.
|
.
This lets us treat either x'00' or x'ff' as NULL, but in our case we want to treat both x'00' and x'ff' as NULL.
Any idea how this can be handled?
Thanks! _________________ Regards
Paul |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 09, 2010 8:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Set the generic default for the copy book and then override once the copy book is imported for specific fields.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 10, 2010 1:47 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
fjp_saper's solution will work if each field uses either 0xFF *or* 0x00 as a null value, but not both. You can set each field to use the null style that you require : http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ad00781_.htm
If you want to recognize both values as NULL then you'll have to find a workaround. That could be quite tricky, because high and low values are usually not valid for the field - so you cannot parse the fields to create a message tree and then cope with the high and low values in the mapping logic.
It sounds as if you may have one or more badly-behaved COBOL applications upstream of your message flow. It doesn't make a lot of sense to mix the two styles ( although I'm not a COBOL expert, so others may disagree ). With that in mind, you may want to check whether a single field value might contain a *mixture* of 0xFF and 0x00. That would make things even more interesting for you  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|