Author |
Message
|
mark.luebinski |
Posted: Wed Sep 19, 2007 2:04 am Post subject: COBOL CopyBook, signed decimal |
|
|
Acolyte
Joined: 27 Mar 2006 Posts: 56
|
Dear Masters,
how must I define COBOL-Strutcture to get mssage-feld with logical typ decimal, CWF-Type "extern decimal", signed (on the first position - not on the last) with 1 virtual sign-position?
Normaly we have to use PIC S9(n), but it don't work, so generate the importer from PIC S9 one short with sign on the last position.
Thank you very much!
Mark |
|
Back to top |
|
 |
kimbert |
Posted: Wed Sep 19, 2007 2:17 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Not sure I understood all of that. Please can you
- give an example of the input field you are trying to parse
- describe the value you want to see in the message tree |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed Sep 19, 2007 3:16 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Do you mean to say that your data is coming as 123.56- and not as -123.56? _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
mark.luebinski |
Posted: Wed Sep 19, 2007 3:46 am Post subject: |
|
|
Acolyte
Joined: 27 Mar 2006 Posts: 56
|
Hi, kimbert,
I imported
11 VTECH-PERIODE PIC S9 VALUE ZERO.
and got (fields a re-translated back from German, so maybe not really the names of English toolkit)
logical properties -> logical element, type -> xsd:short
physical properties -> logical element, physical details
sign - checked
sign alligment -> End
and no chance to get virtual digit (also virtual decimal comma).
I would like to get
logical properties -> logical element, type -> decimal
physical properties -> logical element, physical details
sign - checked
sign alligment -> sign before of first byte
1 virtual comma
The question is: which COBOL-Structure I have to use?
Thank you very much!
Mark |
|
Back to top |
|
 |
mark.luebinski |
Posted: Wed Sep 19, 2007 3:48 am Post subject: |
|
|
Acolyte
Joined: 27 Mar 2006 Posts: 56
|
@shalabh1976
the problem is, I have to READ data and I get parse exception. I cannot use unique PLI-CopyBook because Toolkit cannot manage they, so I "translated" CopyBooks to COBOL. But worse.
Thank you!
Mark |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 19, 2007 4:45 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think if you use PIC +9 VALUE ZERO
You will get something useful. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mark.luebinski |
Posted: Wed Sep 19, 2007 5:44 am Post subject: |
|
|
Acolyte
Joined: 27 Mar 2006 Posts: 56
|
PIC +9 VALUE ZERO. generated STRING field! |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 19, 2007 2:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I think what you're looking for is a comp or comp-3 field which are binary numbers.
This means that the parsing will have to be made in the CCSID of the source...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 20, 2007 2:43 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I asked:
Quote: |
- give an example of the input field you are trying to parse
- describe the value you want to see in the message tree |
So far, you have described you COBOL PIC clause but not your input field.
I suspect that you need PIC S9 (5). The 5 is a guess because I don't know how long your input field is. But it probably is not a 1-digit field, otherwise you would not be setting a virtual decimal separator. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 20, 2007 2:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@ kimbert
Just to clarify my addling mind, in order to have a virtual decimal separator don't you need a binary numeric field?
In which case we would need to have something like
pic S9(x)V9(y) comp-3 ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mark.luebinski |
Posted: Thu Sep 20, 2007 4:46 am Post subject: |
|
|
Acolyte
Joined: 27 Mar 2006 Posts: 56
|
Dear Masters,
@kimbert: I started with PIC S9... It sadly don't work. Sure, I used S9 for 1-digit values and S9(n) resp. S9(n)V(n) for longer and decimal values.
@fjb_saper: comp and comp-3 generated binary data - but xsd:short. And the positoin of the sing is grey, so I cannot set it to "first".
I guess, it is not possible to define the correct cobol-structure And I have to define it manually
But thank you for ideas!
Mark |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 20, 2007 6:56 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
|