ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CAST AS DECIMAL - V5 problem.

Post new topic  Reply to topic
 CAST AS DECIMAL - V5 problem. « View previous topic :: View next topic » 
Author Message
kirani
PostPosted: Fri Dec 17, 2004 5:20 pm    Post subject: CAST AS DECIMAL - V5 problem. Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I am doing a POC for our new servers (Windows 2003 & WBIMB 5.0). I migrated my messageflows from WMQI 2.1 to WBIMB V5.0.
After migrating my architecture level components (plug-in nodes, common sub-flows, error handlers etc) I was able to deploy my message flows and message sets successfully to the V5 broker.

I started my POC testing with this particular message flows that gets it's input from M/F. After transformation the messages are sent back to the M/F queue. Input and output message layout corresponds to the Copybook layout, so the input and output messages are defiend using CWF format.

In the input message we get lots of COMP-3 (Packed decimal) fields, which needs to be transformed into COBOL Display type fields (for example, PIC +9(11).9(2)). These "display type" fields are defined as string fields in MRM-CWF in output message. In the message flow we are doing CAST as Decimal (no prcision given) when populating these fields in output message. When testing with WMQI 2.1 these message flows run fine, but when running with WBIMB 5.0 (CSD4) I am getting some errors. Basically, the CAST statement is adding Extra digits after the actual decimal value, which is causing this problem.

For example, Input field definition for this particular field is PIC S9(11)V9(2) COMP-3 and the output field is defiend as STRING (15 bytes) long. Here is the trace from input/output trace files.
Quote:

Input Value: 1.807E+4 -> This is COMP-3 value.
Output Value: 18070.00000000000 -> don't know where did these leading 0's came from


As you can see the output value is greater than 15 bytes long, so I get an error during runtime. Here is the exception List.
Quote:

**
Exception occured at 2004-12-16 18:15:41.437
(
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S500_P\src\DataFlowEngine\ImbComputeNode.cpp'
(0x03000000):Line = 471
(0x03000000):Function = 'ImbComputeNode::evaluate'
(0x03000000):Type = 'ComIbmComputeNode'
(0x03000000):Name = 'LEW01_MAIN_01#FCMComposite_1_1.LEW01_DTL_PROC#FCMComposite_1_1'
(0x03000000):Label = 'LEW01_MAIN_01.Create_final'
(0x03000000):Text = 'Caught exception and rethrowing'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S500_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp'
(0x03000000):Line = 158
(0x03000000):Function = 'SqlStatementGroup::execute'
(0x03000000):Type = 'ComIbmComputeNode'
(0x03000000):Name = 'LEW01_MAIN_01#FCMComposite_1_1.LEW01_DTL_PROC#FCMComposite_1_1'
(0x03000000):Label = 'LEW01_MAIN_01.Create_final'
(0x03000000):Text = 'Error detected, rethrowing'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 2488
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '.LEW01_DTL_PROC_Create_final.main'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '62.1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'PROPAGATE;'
)
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S500_P\src\DataFlowEngine\ImbMqOutputNode.cpp'
(0x03000000):Line = 751
(0x03000000):Function = 'ImbMqOutputNode::evaluate'
(0x03000000):Type = 'ComIbmMQOutputNode'
(0x03000000):Name = 'LEW01_MAIN_01#FCMComposite_1_1.LEW01_DTL_PROC#FCMComposite_1_15'
(0x03000000):Label = 'LEW01_MAIN_01.LEW01_Out'
(0x03000000):Text = 'Caught exception and rethrowing'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x01000000):ParserException = (
(0x03000000):File = 'F:\build\S500_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbParser.cpp'
(0x03000000):Line = 1221
(0x03000000):Function = 'MtiImbParser::refreshBitStreamFromElements - 9 par'
(0x03000000):Type = 'ComIbmMQInputNode'
(0x03000000):Name = 'LEW01_MAIN_01#FCMComposite_1_11'
(0x03000000):Label = 'LEW01_MAIN_01.LEW01.IN'
(0x03000000):Text = 'ImbRecoverableException caught from worker when attempting to write out the bitstream.'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5286
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'LEW01'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'CWF'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'm_LSUSUNSEC'
)
(0x01000000):ParserException = (
(0x03000000):File = 'F:\build\S500_P\src\cpi\pwf\cwf\cwfworker.cpp'
(0x03000000):Line = 296
(0x03000000):Function = 'CWFWorker::write'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Text = 'CWF General Error'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5167
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '0'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'CWFWorker::write'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'm_LSUSUNSEC'
)
(0x01000000):ParserException = (
(0x03000000):File = 'F:\build\S500_P\src\cpi\pwf\cwf\cwfmessage.cpp'
(0x03000000):Line = 420
(0x03000000):Function = 'CMessage::write'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Text = 'CWF Writing error'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5350
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '0'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'CWFWorker::parseNext'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'm_LSUSUNSEC'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '/m_LSUSUNSEC/LEW01_LSE_USUNSEC_REC/LS_USUNSEC_ABS_EINT'
)
(0x01000000):ParserException = (
(0x03000000):File = 'F:\build\S500_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbValueValidator.cpp'
(0x03000000):Line = 1657
(0x03000000):Function = 'MtiImbValueValidator::basicValidate'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Text = 'The field length was greater than maxLen'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5199
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'LS_USUNSEC_ABS_EINT'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'm_LSUSUNSEC'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '15'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '17'
)
)
)
)
)
)
)
)
)
**


I see that Version 5.0 Broker is doing something funny to my input data and increasing the precision length when doing CAST to DECIMAL type.

I was even able to simulate this problem with a test message flow. The funny thing is that it works fine if the input value ends with 0 ) For example, If my input field contains value 100, then I have no problem in casting this value to decimal, but for the numbers that does not end with 0 it adds leading 0's (or other numbers) and makes it 17 bytes long even.

Has anyone encountered this (or similar) problem before? I can fix my prblem by adding precision when doing CAST, but I have 100's of fields and each one of them have different length.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Mon Dec 20, 2004 3:28 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

mgk/steve, any thoughts on this?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Tibor
PostPosted: Tue Dec 21, 2004 7:21 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Kiran,

I can't solve your problem, just another story: a msgflow stores unix timestamp generated with type interval. A trace snippet:
Code:
2004-12-17 18:35:38.487598     2314   UserTrace   BIP2539I: Node 'HUB_Database_Log.WRITE_DATABASE': Finished evaluating expression 'CURRENT_GMTTIMESTAMP - EpocTimeStamp' at (12, 43). This resolved to 'GMTTIMESTAMP '2004-12-17 17:35:38.471141' - TIMESTAMP '1970-01-01 00:00:00''. The result was 'INTERVAL INTERVAL '1103308538.471141' SECOND'.
2004-12-17 18:35:38.487850     2314   UserTrace   BIP2539I: Node 'HUB_Database_Log.WRITE_DATABASE': Finished evaluating expression 'CURRENT_GMTTIMESTAMP - EpocTimeStamp * 1000' at (12, 67). This resolved to 'INTERVAL INTERVAL '1103308538.471141' SECOND * 1000'. The result was 'INTERVAL INTERVAL '-498056601.141' SECOND'
.


I would understand this result when this number is a 32 bit integer....

But more funny the next step: (casting as INTEGER):
Code:
2004-12-17 18:43:09.178709     2314   UserTrace   BIP2539I: Node 'HUB_Database_Log.WRITE_DATABASE': Finished evaluating expression 'CAST(CAST(EventInterval AS INTEGER) AS DECIMAL)' at (65, 1). This resolved to 'CAST(1103308989160 AS DECIMAL )'. The result was '1103308989160'.


I get back the right value

Tibor
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Dec 21, 2004 7:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Tibor, thanks for sharing the info!

I can solve my problem by specifying Precision and Scale when doing the CAST to Decimal. But, the problem is that I have more than 200 such fields in my message set and all of them have different PIC clause. It'd be very time consuming.

Hopefully, someone from IBM would be able to shed some light on this.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
schofier
PostPosted: Wed Dec 22, 2004 4:13 am    Post subject: Reply with quote

Novice

Joined: 10 Dec 2003
Posts: 14
Location: IBM Hursley

Hi Kiran,

Could you provide me with the logical type and all of the CWF physical properties for one of your problematic fields, for both your input and output message please ?

Thanks in advance

Richard
Back to top
View user's profile Send private message AIM Address
kirani
PostPosted: Wed Dec 22, 2004 12:35 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Richard,

Thanks for looking into this problem.

Here are the details of the input and output element from my sample message set where I was able to reproduced the problem.

Input Element
Logical Properties
Element Name : COMP3
Element Type: Float
Min Occurs: 1
Max Occurs: 1

Physical Properteis (CWF)
Physical Type: Packed Decimal
Length Count: 7
Length Units: Bytes
Signed: Yes
Virtual Decimal Point: 2


Output Element
Logical Properties
Element Name : STR3
Element Type: string
Min Occurs: 1
Max Occurs: 1

Physical Properteis (CWF)
Physical Type: Fixed Length String
Length Count: 15
Length Units: Bytes
String Justification: Left Justify
Padding Character: SPACE

Please let me know if you need anything else.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Wed Dec 22, 2004 11:43 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Richard,

To simulate this problem i creaed two small message flows. First message flow generates output message with COMP-3 fields. This message is then sent to second message flow that converts the input COMP-3 to STRING format. I get error in the second message flow.

If needed, I can email you the message flow and message set files. Please PM me your email address.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
schofier
PostPosted: Thu Dec 23, 2004 4:41 am    Post subject: Reply with quote

Novice

Joined: 10 Dec 2003
Posts: 14
Location: IBM Hursley

Hi Kiran,

I've managed to reproduce your problem and fundamentally I suggest that you raise a problem report (PMR) (there have been changes/improvements to the handling of DECIMAL fields between versions 2.1 and 5 which have resulted in the behaviour that you are experiencing)

Currently, the broker will perform some basic validation of your STRING fields (i.e. MIN/MAX Length checks) regardless of whether or not validation has been requested on your input/compute node. Thus, (as you suspected) since the CAST of your float to a decimal generates a decimal with 17 bytes of precision, when this is converted into a STRING in your output message then the basic validation processing detects this and throws an error. (I suspect that the reason why it works OK when your input value ends in 0 is that during the conversion of a DECIMAL to a STRING, insignificant digits are removed (i.e. all leading/trailing zeros).

However, there are a number of 'workarounds' (in addition to your suggestion of specifying Precision and Scale when performing the CAST) which you might like to consider in the short term. (All will require some model changes I'm afraid ).

1. Rather than defining your input field to be of logical type FLOAT, you could consider defining it as a DECIMAL instead. Certainly, the 5.0 COBOL importer will create an element of logical type xsd:decimal for a copybook field defined as PIC S9(11)V9(2) COMP-3. A decimal is also a better logical representation of a COBOL packed decimal field since some decimal numbers cannot be represented exactly as a FLOAT. Did the 2.1 COBOL importer map your COMP-3 field to a FLOAT ?

2. If you're not concerned about validation, you could consider removing the maximum length constraint on your fields. This way you will not experience the validation exception and the CWF writer will correctly output your field with the appropriate number of digits.

Hope that the above is of some use to you.

Richard
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CAST AS DECIMAL - V5 problem.
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.