PACKED-DECIMAL/COMP-3 
Author Message
 PACKED-DECIMAL/COMP-3

Anyone who wants to know the different COBOL data formats should send me
his fax number.
Those data formats are equal for every COBOL compiler as COBOL has to
comply to CODASYL specifications.
I won't use your number for any other purposes. Give me some time to
answer.
Dirk

  vcard.vcf
< 1K Download


Mon, 25 Sep 2000 03:00:00 GMT  
 PACKED-DECIMAL/COMP-3

You are mistaken in MULTIPLE ways.

1) CODASYL (or at least the COBOL part) is "dead" and has been for several
years.

2) There never was a requirement that compilers conform to the CODASYL JOD
(Journal of Development).  The only "requirement" was conformance to the
ANSI Standard (and/or FIPS certification)

3) Even the JOD did *not* specify what any of the COMP-n values meant. (and
for ANSI, all the COMP-n values *are* extensions)

4) There is no requirement for even COMP as to how it is stored. (There is a
"rumor" - which is currently false - that the ANSI Standard requires COMP to
be the "most efficient" storage mechanism.  This is no where in the current
Standard.)

5) The truth is that COMP-1 thru COMP-9 are truly implemented in different
methods on different machines with different compilers. Taking a simple
example, if you have a usage COMP field on a PC, depending on the vendor:

    A) some compilers allow one byte binary fields - while others always
allocate 2-bytes even for a PIC S9(01) field.
    B) some compilers use big-endian and others use little-endian storage
(and if you don't understand these terms, that is fine - but it means you
don't understand PC storage formats and wouldn't understand how different
compilers use different storage methods)

    *****

Bottom-line:  COMP and COMP-n storage is vendor/platform specific and anyone
who tells you that there is a single "definition" is simply wrong. (As a
matter of fact, the ANSI definition for USAGE BINARY and USAGE
Packed-Decimal leaves a lot to the implementor as well - but at least the
Standard gives some "clues" about how they are stored.)

--
+ +
+   Bill Klein -
         "C" is a nice letter to START the name of your programming language
with
      but I wouldn't want to end up there.

Quote:

>Anyone who wants to know the different COBOL data formats should send me
>his fax number.
>Those data formats are equal for every COBOL compiler as COBOL has to
>comply to CODASYL specifications.
>I won't use your number for any other purposes. Give me some time to
>answer.
>Dirk



Mon, 25 Sep 2000 03:00:00 GMT  
 PACKED-DECIMAL/COMP-3

Quote:

> 4) There is no requirement for even COMP as to how it is stored. (There is a
> "rumor" - which is currently false - that the ANSI Standard requires COMP to
> be the "most efficient" storage mechanism.  This is no where in the current
> Standard.)

The standard never required COMP to be the *most* efficient data
representation, in fact it never required it to be more efficient than
DISPLAY.  I believe JOD said that COMP and COMP-n were various different
data representations, and may have said that ideally COMP was the most
efficient, but I don't think that was ever written as a requirement.
COMP was necessarily not floating point, because it had to have a PIC.

Do we mean storage efficient or speed efficient?  Different
representations might be more speed efficient for different data
ranges.  This happens especially with floating point, but under JOD COMP
was necessarily not floating point, because it had to have a PIC.
Floating point COMP-n fileds don't have PIC, which is hell to the
compiler writer -- it looks like a group USAGE.

Quote:
>     A) some compilers allow one byte binary fields - while others always
> allocate 2-bytes even for a PIC S9(01) field.

Some compilers allow half byte decimal fields.  On Unisys A Series, PIC
9 COMP occupies four bits.

--
I  |\   Randall Bart

o  |\   1-310-542-6013                       Please reply without spam
v  | \  
e    |\ Todd McCormick jailed for using Marinol with prescription:
Y    |/        http://{*filter*}magazine.com/toc/articles/toddheld.html
o    |\ Panic in the Year Zero Zero:   http://www.*-*-*.com/ ;
u    |/ Is it easy yet?: http://www.*-*-*.com/



Mon, 25 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Micro Focus Cobol Packed Decimal (Comp-3) problem

2. Comp-3 / Computational-3 / Packed-Decimal

3. Float to Packed decimal

4. Convert Dbl float to packed decimal

5. Packed-Decimal Validation

6. CONVERTION DECIMAL IN PACKED NUMBERS

7. CONVERTION DECIMAL IN PACKED NUMBERS

8. packed decimal

9. Packed decimal in input ASCII File

10. Validating packed decimal data

11. packed decimals

12. Validate Packed Decimal

 

 
Powered by phpBB® Forum Software