Home > Archive > Cobol > November 2004 > Re: Internal sign encoding in DISPLAY and PACKED-DECIMAL usage
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Internal sign encoding in DISPLAY and PACKED-DECIMAL usage
|
|
| Vincent Danion 2004-11-17, 8:55 am |
| William,
Thank you for your answer and congratulation for your Faq: it is very
documented and interesting.
William M. Klein wrote:
> You have mixed "apples and oranges" - although you may well be correct that
> there is an error in the documentation.
>
> What the Enterprise COBOL LRM states *is* true for the Enterprise COBOL
> compiler.
>
> It is *NOT* (always) true for IBM's COBOL for Windows. The sign-nibble on the
> PC (with the IBM compiler - and several others) is the same between
> Packed-Decimal and Zoned Decimal when the compiler is in "EBCDIC" mode but IS
> not the same when in ASCII mode.
OK, I understand that. It is like in ASCII mode the DISPLAY sign
representation should be compatible with ASCII 7 bits (therefore lower
than 7F), while the PACKED sign representation need not to be
"printable" (ie it can be the same Ci, Di or Fi than in EBCDIC), isn't it ?
> Some compilers (for example Micro Focus) has an option for working in ASCII
> mode - but using EBCDIC sign-nibbles (or vice versa - I can't remember off the
> top of my head). However, this is NOT true for the IBM Windows compiler.
>
> I don't see a separate web page for the "IBM Websphere Studio COBOL for Windows
> V5.11" manuals, but the VisualAge COBOL (predecessor product) is at:
> http://www-306.ibm.com/software/awd...bol/va/library/
In fact, there is here:
http://www-306.ibm.com/software/awdtools/cobol/library/
You can find on this page two links regarding "COBOL for Windows", one
for Language Reference and the other for Programming Guide.
> and that seems to indicate that it uses the same LRM as the "mainframe" (older
> version IBM COBOL for OS/390 & VM) LRM. If that is still the case with the
> current Windows compiler, then what you have found is a "bug".
Indeed there is now a separate LRM for Windows but it says exactly the
same thing regarding 4-bit sign representation (p.213). IMHO, this is at
least confusing...
I have another question about the sign position. I was thinking that the
default was TRAILING, but the IBM Websphere Studio COBOL PGM for Windows
V5.11 shows (p. 37 again) the following example:
For "PIC S9999 DISPLAY", the value -1234 is encoded like this (NATIVE):
71 32 33 34
For "PIC S9999 DISPLAY", the value -1234 is encoded like this (EBCDIC):
F1 F2 F3 D4
Therefore, in the first case, the sign seems to be held by the first
byte (71)... but I found no mention of this particularity. Do you have
an idea about that ?
Best Regards,
--
Vincent Danion.
| |
| William M. Klein 2004-11-18, 3:55 am |
| The LRM seems to contradict the examples in the PG. I have sent a query to one
of my "usually reliable sources" in IBM.
My *guess* is that it is the LRM that is wrong and that for some reason
WebSphere COBOL for Windows defaults to "leading" rather than trailing signs.
If this is true, it would cause a medium serious "migration inhibitor" for
people trying to migrate existing IBM mainframe COBOL applications to that
environment (as redefines that assume trailing are fairly common).
However, as I don't have the product myself, I'll wait to see what response (if
any) I receive.
--
Bill Klein
wmklein <at> ix.netcom.com
"Vincent Danion" <vdaNOniSPAMon@scort.com> wrote in message
news:300l0vF2q72joU1@uni-berlin.de...
> William,
>
> Thank you for your answer and congratulation for your Faq: it is very
> documented and interesting.
>
> William M. Klein wrote:
>
>
> OK, I understand that. It is like in ASCII mode the DISPLAY sign
> representation should be compatible with ASCII 7 bits (therefore lower than
> 7F), while the PACKED sign representation need not to be "printable" (ie it
> can be the same Ci, Di or Fi than in EBCDIC), isn't it ?
>
>
> In fact, there is here:
>
> http://www-306.ibm.com/software/awdtools/cobol/library/
>
> You can find on this page two links regarding "COBOL for Windows", one for
> Language Reference and the other for Programming Guide.
>
>
> Indeed there is now a separate LRM for Windows but it says exactly the same
> thing regarding 4-bit sign representation (p.213). IMHO, this is at least
> confusing...
>
> I have another question about the sign position. I was thinking that the
> default was TRAILING, but the IBM Websphere Studio COBOL PGM for Windows V5.11
> shows (p. 37 again) the following example:
>
> For "PIC S9999 DISPLAY", the value -1234 is encoded like this (NATIVE):
> 71 32 33 34
>
> For "PIC S9999 DISPLAY", the value -1234 is encoded like this (EBCDIC):
> F1 F2 F3 D4
>
> Therefore, in the first case, the sign seems to be held by the first byte
> (71)... but I found no mention of this particularity. Do you have an idea
> about that ?
>
> Best Regards,
>
> --
> Vincent Danion.
|
|
|
|
|