Author |
Message
|
vishal |
Posted: Fri Apr 02, 2004 12:42 pm Post subject: Pcaked decimal problem casting |
|
|
 Novice
Joined: 01 Feb 2004 Posts: 13
|
I am getting a field from mainframes side as PIC S(07) v99 COMP-3
When I imported MRM created a logical type as an integer and the physical type as packed decimal with a count of 5.Does the count to be 5 or 9 and do we need to set the virtual decimal as 2.
When I tried to map this field to one of the XML tags..recieving an error
as
Data conversion failed: data invalid.
Type of data being read : 'packed decimal, non-numeric data found'
Data : '0x2e2e2e2e2e'
A data conversion during reading or writing of a message failed because the input data was invalid for the output data type.
Check that the message model is correct.
Can any one help on this....
Thanks,
vinay |
|
Back to top |
|
 |
Missam |
Posted: Fri Apr 02, 2004 4:30 pm Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
the length of the variable should be 10 including sign.but you wont see any decimal in the actual data.
Lets see how the actual data represent for PIC S(07) V99 looks like
+123456789 and 1234567 is the value before decimal point and 89 is the precision and you should keep in mind that the actual decimal value is +1234567.89.i beleive that the best of handling this is creating element of datatype String with length 10 and let the MRM parser parse it.
And inside the compute node you use couple of substrings and a cast to convert it and assign it to a decimal variable. |
|
Back to top |
|
 |
vishal |
Posted: Fri Apr 02, 2004 5:51 pm Post subject: |
|
|
 Novice
Joined: 01 Feb 2004 Posts: 13
|
Can you plz suggest or post the code in ESQL for casting..
One more thing to keep in mind is the incoming field is in COMP-3 so, the parser would always treat it as a packed decimal. and the logical type in MRM is an INTEGER.
How would I cast this and assign to a XML tag in ESQL.
PLZ take a look at the error posted in my earlier message..
YOURS THOUGHTS AND SUGGESTIONS................................ |
|
Back to top |
|
 |
Lisa |
Posted: Fri Apr 02, 2004 11:35 pm Post subject: Signed |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Please search the forum for 'Signed', there are a lot of posted items regarding your current problem.
IBM suggested that we upgrade to CSD05 in order to correct our problem. You should also check to make sure that Convert is set to No in your channel.
Lisa |
|
Back to top |
|
 |
Missam |
Posted: Sat Apr 03, 2004 6:46 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
can you post exactly how your compound type looks like and the sample data here.just i want to see how many element you got and how the data looks like. |
|
Back to top |
|
 |
kirani |
Posted: Sat Apr 03, 2004 11:06 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Vinay,
Something must have gone wrong when importing this copybook. Your element should have been defined as FLOAT into MRM after the import. As sam said, the total length should be 10 and virtual decimal point length would be set to 2. _________________ 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 |
|
 |
vishal |
Posted: Sat Apr 03, 2004 2:10 pm Post subject: |
|
|
 Novice
Joined: 01 Feb 2004 Posts: 13
|
OK....HERE IS WHAT I DID..
I tried the other way round..
I defined the logical structure in the MRM as below:
I just defined a field as an Integer.
PHYSICAL TYPE: Packed decimal.
length count :5
signed : yes
My input message is in XML format.
<float>1234567.99</float>
SET OutputRoot.MRM.Field=InputBody.float;
The message was sucessfully propogated to the output node.
Physically the message is as
CHARACTER: ....
HEXA: 2E2E2E2E 2E
Here is my question...
But when I tried the other way round,,I could not get the message ///dat conversion error is encountered...
The length count should be 5 bytes as it is V99 as my knowledge goes..
So the representation would be
13579
2469C
C implies the + sign.
Are my BASICS RIGHT...
AS the element is PIC S(7) V99 COMP-3..
WHen you import this it is imported as an integer and physical type packed decimal with length count 5.
May be I can be wrong too...Please do try this and advice me...
YOURS THOUGHTS.. |
|
Back to top |
|
 |
Missam |
Posted: Sat Apr 03, 2004 4:49 pm Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
I Believe that there is some thing wrong in your BSD.you need to clarify this with your business analyst what exactly the representation should be.whether its S(7)V99 which is 10 bytes long or some thing else which is representing a length of 5.
If C represents + ,so what negative numbers represent.if you pass 2469C into a packed decimal variable it'll defenetly complains
Quote: |
Data conversion failed: data invalid.
Type of data being read : 'packed decimal, non-numeric data found'
Data : '0x2e2e2e2e2e' |
B'cause 2469C is no way a packed decimal.
there are lot of things you need to take care while coding this requirement.
The first thing you need to do is confirm this issue about S(9)V99. |
|
Back to top |
|
 |
kirani |
Posted: Sat Apr 03, 2004 6:41 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
vishal wrote: |
I just defined a field as an Integer.
|
This means you did not import the copybook?
vishal wrote: |
The message was sucessfully propogated to the output node.
|
What is your CCSID and Encoding set on the output message?
vishal wrote: |
But when I tried the other way round,,I could not get the message ///dat conversion error is encountered...
|
How did you put your message on the queue? If you are just typing in the message using MQSeries Explorer, then it's not going to work. Either you need to use some COBOL program to put data on the queue, which will set proper byte order, or you use some supportpac utility to put message on the queue. For packed decimal fields, Byte order is very important.
vishal wrote: |
AS the element is PIC S(7) V99 COMP-3
|
I see there is SPACE before V and there is a missing 9 after S, which is why I think the import did not work correctly. Your copybook should say,
Code: |
05 FIELD1 PIC S9(7)V99 COMP-3.
|
Hope this helps. _________________ 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 |
|
 |
vishal |
Posted: Sat Apr 03, 2004 7:04 pm Post subject: |
|
|
 Novice
Joined: 01 Feb 2004 Posts: 13
|
Kiran,
Thanks for the response..Sorry for the confusion..Disregard my earlier message.The cobol copy book is ok..I misprinted the format..
It is the same as you suggested....
So, when I imported it is declared as FLOAT in MRM and the
Logical type as packed decimal
and the length count as 5
and the virtual decimal as 2.
I was testing my flow locally on my machine, with the test data provided by the mainframes cobol. So, I am assigning the fields to specific XML fields.Evry thing is working ok except the Float field.When I see the data the physical representation as ..... in the ASCII format occupying just 5 bytes.
How do I assign this..Do I need to cast it before assigning to the XML field.
I am new to this cobol basics.Please do advice on this.
The error encountered in the compute node;
Data conversion failed: data invalid.
Type of data being read : 'packed decimal, non-numeric data found'
Data : '0x2e2e2e2e2e'
Is the test data wrong or the my message model is wrong..Because I used the copy book to generate the message set.
YOUR THOUGHTS and SUGGESTIONS REQUIRED |
|
Back to top |
|
 |
kirani |
Posted: Sat Apr 03, 2004 11:32 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
It seems like your input data is incorrect. I think it's missing the Sign indicator. _________________ 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 |
|
 |
Missam |
Posted: Sun Apr 04, 2004 7:59 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Thats what i'm trying to say.
vishal:
Quote: |
How do I assign this..Do I need to cast it before assigning to the XML field.
|
vishal :
Quote: |
SET OutputRoot.MRM.Field=InputBody.float; |
which one of the above statement is correct.Whether you have input cobol cpy book converting to XML or viceversa.
If you are constructing cobol copy book format(output MRM,input XML).you can't say that your input data is wrong. |
|
Back to top |
|
 |
|