|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Writing an Outbound Message Based on COBOL Copybook |
« View previous topic :: View next topic » |
Author |
Message
|
bobby |
Posted: Fri Oct 25, 2013 6:01 am Post subject: Writing an Outbound Message Based on COBOL Copybook |
|
|
Newbie
Joined: 25 Oct 2013 Posts: 3
|
Hello all. I am trying to write an outbound message that is based on a COBOL Copybook and I'm running into an issue. Here's the scenario.
There are 10 fixed length strings in the outbound message. I only have to map 3 of them. I want the remaining 7 fields to contain spaces without my having to populate them using the SPACE (x) function.
I have tried various things to ensure that the 7 "unmapped" fields are populated with spaces including setting the logical Nillable property, setting the VALUEs of the fields to NULL, setting the fields to NULL, and setting the physical property Encoding Null to NullPadFill.
The only solution that I have found to work is to set the logical property Default Value to a single space character.
What is the best way to populate the 7 "unmapped" fields with spaces? Is there any other way than setting the logical property Default Value to a single space?
I am using WMBT 7.0.0.6. BTW, the physical property Padding Character is set to SPACE.
Any guidance is greatly appreciated. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 25, 2013 6:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm confused.
You have a working solution.
What's wrong with it?
Also, there's a difference between a logical message tree that has ten elements of which seven contain NULL values and a logical message tree that has three elements. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 25, 2013 6:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
The only solution that I have found to work is to set the logical property Default Value to a single space character.
What is the best way to populate the 7 "unmapped" fields with spaces? Is there any other way than setting the logical property Default Value to a single space? |
I cannot think of a better way. There are alternative ways. You could set the missing fields to NULL and use NullPadFill ( which does work btw ) but that requires you to write code.
I think the solution that you have found is a good one. Your message set is describing the format of your output message, and the message flow logic does not need to worry about it. That is exactly how things should be done, in my opinion. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
bobby |
Posted: Fri Oct 25, 2013 6:27 am Post subject: |
|
|
Newbie
Joined: 25 Oct 2013 Posts: 3
|
mqjeff,
Thank you for the quick response.
The problem with the current solution is that I have to use the Message Definition Editor to specify a single space character for all "unmapped" fields that I want to be filled with spaces. While 7 fields is manageable, outbound messages that contain dozens of "unmapped" fields is not so manageable. Of course, I can simply edit the file with a text editor and set the default value more easily.
Yes, the solution I have works, but I was hoping that there was something I was doing wrong that preventing the fields from being filled without my having to specify a default value of a single space character. In fact, I was hoping that the NullPadFill property, in combination with the Padding Character property, would do the trick.
The documentation for the Encoding Null property reads as follows: NullPadFill. This option is valid only if Physical Type is Fixed Length String. The field is filled with the value specified by the Padding Character. The default value.
Seems like the combination of a Encoding Null property value of NullPadFill and a Padding Character of SPACE should do the trick.
Can you please explain what I'm missing? |
|
Back to top |
|
 |
bobby |
Posted: Fri Oct 25, 2013 6:40 am Post subject: |
|
|
Newbie
Joined: 25 Oct 2013 Posts: 3
|
kimbert,
Thank you for the quick response.
I have tried the combination of an Encoding Null property value of NullPadFill and setting the 7 "unmapped" fields to NULL, but I have not been able to get this to work. I have also tried the combination of an Encoding Null property value of NullPadFill and setting the VALUEs of the 7 "unmapped" fields to NULL, but does not seem to work for me either.
Both of these combinations results in a BIP5344 exception: CWF Logical Tree - Message Definition Mismatch.
If you know how to get either of the above combinations to work, please share the solution with me. I think either of the two would be better than having to specify a Default Value of a single space character. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 25, 2013 6:52 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
The problem with the current solution is that I have to use the Message Definition Editor to specify a single space character for all "unmapped" fields that I want to be filled with spaces. |
The COBOL importer can do that for you. There is an option on the importer wizard that causes VALUE clauses to be turned into default values in the model. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
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
|
|
|
|