HP3000-L Archives

October 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ric Merz <[log in to unmask]>
Reply To:
Date:
Sat, 21 Oct 2000 21:44:54 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
At 10:37 PM 10/21/2000 -0400, you wrote:
>>
>>  In COBOL II,  an IMAGE J2 field is defined as a binary integer with a
>>  minimum length of 5 and a maximum length of 9 digits.
>
>Although the manuals may suggest an interpretation something like the comment
>above, your statement is a mild misinterpretation of what is actually being
>said. The way that the manual's comments should be read is: if you need a
>COBOL binary integer between 5 and 9 digits, then a J2 datatype will fill
>your bill. A J1 datatype won't be big enough, and a J4 would be overkill.
>
>What's not being said, even though it could be read that way, is that a J2
>datatype can only legitimately contain numbers with a minimum of 5 digits and
>a maximum of 9 digits. A COBOL-legitimate datavalue for a J2 field can range
>from 0 (1 digit) to plus or minus 999999999 (nine digits) -- and that's only
>if the application program enforces those rules. IMAGE itself, as I mentioned
>earlier, doesn't impose any restrictions on the bit patterns that can be put
>into the 32-bits of a J2 dataitem.
>
>Wirt Atmar
>

I disagree.  I have never heard of a simple data type that doesn't allow
the value of 1, 2 ...  What the manuals are stating is that if you will
need from 5 to 9 decimal digits, then it will take a 32 bit binary field to
store that range of numbers (J2).  That doesn't exclude the values from 1
to 4 digits.  (Of course it's all base on the fact that decimal numbers
don't map directly into binary numbers.)  In other words, the value 1 is a
legitimate value for a J2 datatype in Image just as it is in a Cobol S9(9)
Comp field.


Ric
[log in to unmask]

ATOM RSS1 RSS2