Author |
Message
|
EgilsJ.Rubenis |
Posted: Tue Apr 17, 2007 5:51 am Post subject: cobol packed decimal (WBIMB V5. 06) |
|
|
Acolyte
Joined: 18 Nov 2002 Posts: 63 Location: Germany, Alfeld
|
Hi,
i generated a message by importing a cobol copybook. It contains a clause
"07 fldname PIC S9(12)V9(6) COMP-3 VALUE ZERO." whereof i would say it should come up in the message definition with
" Type: Packed Decimal
Length: 18
Signed: Yes
Virtual Decimal Points: 6
I understand all this. But i can't find the place to set it manualy to packed decimal with virtual dec points 6. I just hav "xsd:decimal" as base type.
But in the message it just says type XSD:decimal. Mapping the inbound to the outbound it comes up with a catch:
(0x01000000):ConversionException = (
(0x03000000):File = 'F:\build\S500_P\src\cpi\bsutils\datacnv.cpp'
(0x03000000):Line = 3638
(0x03000000):Function = 'DataCnv::PckdDecFromDec'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Text = 'CPI InputData Too Long'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5507
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'decimal'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'packed decimal'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '10'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '123456789012123456'
Thanks for your help
Cheers, Egils[/list] |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 17, 2007 6:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You would set these on the physical properties of the CWF layer for the element. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EgilsJ.Rubenis |
Posted: Tue Apr 17, 2007 7:06 am Post subject: |
|
|
Acolyte
Joined: 18 Nov 2002 Posts: 63 Location: Germany, Alfeld
|
Thanks jefflowrey,
the definition is:
Packed Decimal
Length: 10
Signed: Yes
Virtual Decimal Points: 6 for
"07 fldname PIC S9(12)V9(6) COMP-3 VALUE ZERO."
But still i get the same catch on the field.
Is the length wright? 12 + 6 = 18 / 2 = 9+1 = 10. Or do i have to aplly the total unpacked length (18 bytes) as length ?
Cheers, Egils |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 17, 2007 8:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's been a while since I've worked with packed decimals. I would tend to take the length that is produced when you import the CopyBook into a CWF message.
That is, trust the product to do the right thing.
But the length on the CWF element is the number of bytes used to represent the data, not necessarily the number of digits used. And it should be the number of bytes to represent the packed number, not the unpacked number - as it represents the length of the data in the bitstream, not the logical representation of that data. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wbi_telecom |
Posted: Tue Apr 17, 2007 11:49 am Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
The error you are getting (BIP5507) indicates that
"A data conversion during reading or writing of a message failed because the input data was too long for the output data type"
Also I see 18 bytes in the "data value" and 10 in the "maximum expected length" in the trace of your exception. I think the message set is trying to fit a 18 byte field in the field that has 10 byte as maxium length.
(courtesy contact admin messages in Information center)
Can you try to change the length to 18 and test. I agree that once you import the copybook with packed decimal into broker, it should take care of the length but it's not working in this case.
Cheers, |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 17, 2007 11:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's also possible that your field is too long to be handled by Broker.
The info center suggests that 10 bytes is the maximum length for a PackedDecimal. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EgilsJ.Rubenis |
Posted: Wed Apr 18, 2007 12:45 am Post subject: not working |
|
|
Acolyte
Joined: 18 Nov 2002 Posts: 63 Location: Germany, Alfeld
|
Hi guys,
thanks for your input.
i tried:
putting total length to 18. Is not working.
Am i wrigtht by just mapping it it like "set a = b" ?
whereof a is a decimal field with 12,6 (total18) and b is the same just packed. Or do i need to do a cast?
Lets say the definition is really to long.
If nothing is working what are the chances. Do i need to develop it on my own?
Does somebody know an IBM techi who could answer this?
Cheers, Egils |
|
Back to top |
|
 |
EgilsJ.Rubenis |
Posted: Wed Apr 18, 2007 1:01 am Post subject: |
|
|
Acolyte
Joined: 18 Nov 2002 Posts: 63 Location: Germany, Alfeld
|
Hi,
looking at the manual i found following:
PIC 9(m)V9(n) COMP or COMP-3
Integer or Packed Decimal
Length = CEILING((n+m+1)/2) for COMP-3
Virtual Decimal Point = n
Would mean, that my field lenth should be 10 ((12+6)+1)/2 = 10bytes
by the way this seems as trhe max that is possible for a packed field |
|
Back to top |
|
 |
wbi_telecom |
Posted: Wed Apr 18, 2007 5:45 am Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
Your message set definition looks right. Is it possible that the value you are getting is not adhering to the datatype. I am not an expert in mainframe technologies but are you expecting 123456789012123456 in that field? (That's what is present in the exception).
I have imported copybooks with packed decimal before and I do not recall any additional setting that I had to make after the import. The length is taken care off by the broker while it imports.
Cheers, |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 18, 2007 8:56 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
i can't find the place to set it manually to packed decimal with virtual dec points 6 |
Go to the Broker Development perspective. First select your element in the Outline view at the bottom left of the screen. At the bottom of the main editor window, there are two tabs labelled 'Outline' and 'Properties'. Select Properties and then select your CWF physical format from the tree view on the left. |
|
Back to top |
|
 |
littlechild |
Posted: Thu Apr 26, 2007 6:15 am Post subject: |
|
|
Novice
Joined: 22 Apr 2007 Posts: 17
|
looking at the manual i found following:
PIC 9(m)V9(n) COMP or COMP-3
Integer or Packed Decimal
Length = CEILING((n+m+1)/2) for COMP-3
----------------------------------------------------------------
AFAIK the above calculation is true when the data type is for PIC S9(m)V9(n).
For PIC 9(m)V9(n) this Length = CEILING((n+m)/2) is correct.
Assume you have create msg set well the data length for this would be 9 if data type is PIC 9(m)V9(n) else 10 for PIC S9(m)V9(n).
and while writting in mainframe this "v" doesnot means that decimal will be phisically present.This "v" is for its internal understanding of main frame.
so if ur giving you are giving i/p as 1222.000000 it wil take as 1222000000. |
|
Back to top |
|
 |
|