|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MRM and unitialized fields |
« View previous topic :: View next topic » |
Author |
Message
|
sclarke |
Posted: Sun Jan 06, 2002 8:30 am Post subject: |
|
|
Apprentice
Joined: 05 Jan 2002 Posts: 39
|
I have data coming from a legacy mainframe system which contains comp-3 fields. MQSI handles these just fine - they are defined as float in the MRM. I have a problem that some of these fields are initialized to spaces on the input. As mqsi parses this data, it fails because it is an invalid packed field. If I define these as string and then try to cast back as float I get an error as well. Is there any way to handle this?
Thanks for any help. |
|
Back to top |
|
 |
mpuetz |
Posted: Mon Jan 07, 2002 8:39 am Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
COMP-3 means 3 byte length packed decimal encoding, allowing for 4 decimal digits, right ?
That means you are truly at a somewhat lost
position in this case since your trick parsing as string first and then recasting
to decimal o float won't work because you have a *packed* decimal encoding and MQSI can only do casts from an unpacked decimal encoded string.
If at all possible try to fix this
at the message generation level, so you will
have a valid COMP-3 compliant value in your message. Sigh, I know this is not always possible, so here is a tricky, but possible
route to solve this problem purely within
MQSI.
Basically you have to parsre your message
twice, first parse the fields with COMP-3
as BINARY type (available in MQSI 2.0.2)
then set all COMP-3 fields which are
all blanks to something meaning i.e.
0x00000F (for a 4 digit COMP-3 variable)
which means +0 in COMP-3 encoding.
Then you would reparse the message the
message with a ResetContentDescriptor node
with a slightly modified message type which
now parses the COMP-3 fields as floats in
3-byte packed decimal representation.
That should do the trick.
Note, that haven't tested this explicitly
but it worked for me in very similar situations. You should also be aware, that
reparsing the message is quite costly
in terms of performance (hence my suggestion
to fix this if possible at the source level).
_________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
rdw |
Posted: Tue Jan 21, 2003 8:53 pm Post subject: |
|
|
Newbie
Joined: 16 Jan 2003 Posts: 3
|
Does anyone know if WMQI 2.1 CSDx has provided a more elegant way to deal with this problem?
It seems it is common for COBOL programs to INITIALIZE segments in their copybooks and if there is no information available in the database for these segments they will not be populated with valid COMP-3 values but rather spaces.
thanks _________________ rdw |
|
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
|
|
|
|