Sorry Joe,
but some of your clarification is quite misleading.
>>As we all know, the legitimate value of a J2 data item can range from zero
>>to + or - 999999999.
***
we all *should* know that
The range of a J2 item is : -2147483648 to 2147483647
{ ie., -2^32 to (2^32)-1 }, as Wirt correctly implies.
***
No buts or words of any form can change this.
and if *even* if you define a Cobol binary item as only pic s9(5), Cobol will
perform
all arithmetic and comparisons within that range with NO problem.
It is only when you come to move the item (directly or indirectly) that Cobol
does its truncation, as shown in the example below.
(The display verb indirectly moves the item to an edited field.)
Regards,
Tad "Thought we gave up on decimal computers long ago"
00008 001000$control post85
00008 001100 Identification division.
00009 001200 Program-id. J2items.
00010 001600 Data division.
00011 001700 Working-storage section.
00012 001800 01 J2x5 binary pic s9(5).
00013 001900 01 J2x9 binary pic s9(9).
00014 002000 01 J4x10 binary pic s9(10).
00015 005400*---------------------------------------------------------
-------*
00016 005500 Procedure division.
00017 005600*---------------------------------------------------------
-------*
00018 005700 begin-J2demo1.
00019 005800 multiply 147483647 by 1 giving J2x5
00020 005801 add 2000000000 to j2x5
00021 005810 move j2x5 to j2x9 j4x10
00022 005900 display "j2x5=" j2x5 ",j2x9=" j2x9 ",j4x10" j4x10
00023 009600 continue.
00024 009700 end-J2items.
00025 009800 goback.
00027 009810 end program J2items.
00028 009900
0 ERROR(s), 0 QUESTIONABLE, 0 WARNING(s)
DATA AREA IS 50 BYTES.
CPU TIME = 0:00:00. WALL TIME = 0:00:00.
END OF PROGRAM
END OF COMPILE
HP Link Editor/iX (HP30315A.06.10) Copyright Hewlett-Packard Co 1986
LinkEd> link
END OF LINK
j2x5=+83647,j2x9=+147483647,j4x10+2147483647
___________________________________________________________
This message and any attachments (the "message") are intended solely for
the addressees and are confidential. If you receive this message in error,
please delete it and immediately notify the sender.
Any use not in accord with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The internet can not guarantee the integrity of this message. BNP PARIBAS
(and its subsidiaries) shall (will) not therefore be liable for the message
if modified.
--------------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le "message") sont
etablis a l'intention exclusive de ses destinataires et sint confidentiels.
Si vous recevez ce message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur.
Toute utilisation de ce message non conforme a sa destination, toute
diffusion ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse.
L'internet ne permettant pas d'assurer l'integrite de ce message, BNP
PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
___________________________________________________________
|