Author |
Message
|
ikumar |
Posted: Sun May 25, 2008 4:18 pm Post subject: Decimal number in CWF format |
|
|
Newbie
Joined: 25 May 2008 Posts: 8
|
HI,
Am trying to convert an XML input message to a CWF output message.
Am not able to define the message set to give me a decimal value as the output. Here's what i need.
If an element has value 1234.56 The output should be similar with padded 0s to fill the length of the field.
The cobol copy book defines this field with data type as PIC 9(4).9(3). When i use this cobol copy book to create a message definition, this field data type is converted to xsd:string, instead of decimal and if i try to change it to decimal, Am not getting the expected value in the output.
Has anyone faced this issue? Please advice.
thanks in advance. |
|
Back to top |
|
 |
harish_td |
Posted: Sun May 25, 2008 5:46 pm Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Edited
Last edited by harish_td on Sun May 25, 2008 5:53 pm; edited 1 time in total |
|
Back to top |
|
 |
harish_td |
Posted: Sun May 25, 2008 5:52 pm Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Hi Kumar,
Change your copybook to read PIC9(4)V9(3) instead of the symbolic PIC 9(4).9(3). The V to indicate the virtual decimal point.
Since the definition is still valid, the missing V is causing the message set generator to represent the field as a string.
Hope that helps,
Harish |
|
Back to top |
|
 |
ikumar |
Posted: Sun May 25, 2008 8:46 pm Post subject: |
|
|
Newbie
Joined: 25 May 2008 Posts: 8
|
Thanks for the reply Harish, it does convert the data type to xsd:decimal. But in the output message, i cannot see the decimal point, It just removes the decimal point. Any thoughts on how to retain the decimal point ?
thanks |
|
Back to top |
|
 |
kimbert |
Posted: Tue May 27, 2008 4:26 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
As far as I can tell, COBOL external decimals always use a virtual decimal point. You could try using TDS instead of CWF. |
|
Back to top |
|
 |
ikumar |
Posted: Tue May 27, 2008 4:39 pm Post subject: |
|
|
Newbie
Joined: 25 May 2008 Posts: 8
|
Thanks Kimbert, I didn't understand what you mean by "virtual decimal point". I was working with mainframe team and they did show me an old message which had decimal point in it and they expect the new message in the same format.
Using TDS is fine, But then i want to use the cobol copy book to define my message set. Is there no way i handle decimals as needed using CWF?
thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 27, 2008 4:48 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
"virtual decimal point" means "a string of digits without a decimal point in them, where everyone agress where the decimal point 'should' be".
So a number 123456789 could be .123456789, or 1.23456789 or 12.3456789 or etc. etc. etc. depending on what the COBOL copybook says, which will have something like 99V9999999 for the last option there. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed May 28, 2008 1:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
But then i want to use the cobol copy book to define my message set |
Then you need to find a way to describe your numeric format using COBOL. I suggest that you speak to a COBOL expert about that. |
|
Back to top |
|
 |
|