Author |
Message
|
sandman147 |
Posted: Thu Feb 06, 2014 8:08 am Post subject: Decimal Points from COBOL |
|
|
Apprentice
Joined: 01 Sep 2013 Posts: 42
|
I have with me a msg def file created from a cobol copybook. I have a complex type 'BATCH' (Fixed Length) with elements
BATCH_RECORD (Properties; Physical Type:TEXT Length:4 )
BATCH_CHK_TOTAL (xsd:decimal) (Properties; Physical Type:Ext Decimal Length:14)
BATCH_CHK_COUNT (Properties; Physical Type:TEXT Length:5)
BATCH_REMIT_TOTAL (xsd:decimal) (Properties; Physical Type:Ext Decimal Length:14)
BATCH_REMIT_COUNT (Properties; Physical Type:TEXT Length:5)
BATCH_SUPP_TOTAL (xsd:decimal) (Properties; Physical Type:TEXT Length:4)
BATCH_SUPP_COUNT (Properties; Physical Type:Ext Decimal Length:14)
BATCH_FILLER (Properties; Physical Type:TEXT Length:16)
From the cobol copybook
BATCH_CHK_TOTAL PIC 9(12)V99 VALUE ZEROES.
BATCH_REMIT_TOTAL PIC 9(12)V99 VALUE ZEROES.
BATCH_SUPP_TOTAL PIC 9(12)V99 VALUE ZEROES.
Output Message Values
BATCH_RECORD ='98SD'
BATCH_CHK_TOTAL = '0'
BATCH_CHK_COUNT = '0'
BATCH_REMIT_TOTAL = '0'
BATCH_REMIT_COUNT = '0'
BATCH_SUPP_TOTAL = '0'
BATCH_SUPP_COUNT = '0'
BATCHFILLER = ' '
case 1:
In msg set Strict Numeric Checking = unchecked. Elements with base type xsd:decimal have External Decimal physical type and Virtual Decimal point = 2
Output for case1
98SD000000000000000000000000000000000000000000000000000000000
case 2:
In msg set Strict Numeric Checking = checked. Elements with base type xsd:decimal have TEXT physical type and precision = Explicit Decimal Point - decimal separator always required
Output for case2
98SD0000000000000.000000000000000000.000000000000000000.00000
case3:
In msg set Strict Numeric Checking = checked. Elements with base type xsd:decimal have TEXT physical type and precision = 2
Output for case 3
98SD00000000000.000000000000000000.000000000000000000.0000000
DESIRED OUTPUT
98SD000000000000.0000000000000000000.0000000000000000000.0000000
How can I generate the desired output ? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 06, 2014 8:17 am Post subject: Re: Decimal Points from COBOL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sandman147 wrote: |
DESIRED OUTPUT
98SD000000000000.0000000000000000000.0000000000000000000.0000000
How can I generate the desired output ? |
Why is this desired? It doesn't match the COBOL layout. The V in the picture clause is a virtual point not a physical one. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sandman147 |
Posted: Thu Feb 06, 2014 10:06 am Post subject: |
|
|
Apprentice
Joined: 01 Sep 2013 Posts: 42
|
ok, and if I actually wanted to insert a physical decimal point so it may be displayed in the output message, I would have to code that logic or can I configure this from within the message set ?
Example 123456789012.34 instead of 12345678901234 |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 06, 2014 10:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sandman147 wrote: |
ok, and if I actually wanted to insert a physical decimal point so it may be displayed in the output message, I would have to code that logic or can I configure this from within the message set ?
Example 123456789012.34 instead of 12345678901234 |
The only difference I can see between case 3 and your desired output is field length. The message set can control that.
And again, that physical point doesn't match the picture clause. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sandman147 |
Posted: Thu Feb 06, 2014 10:48 am Post subject: |
|
|
Apprentice
Joined: 01 Sep 2013 Posts: 42
|
I will look into it. Thank you |
|
Back to top |
|
 |
|