Re: Setting A Hex Value in COBOL




"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5c6j97F2ve8jcU1@xxxxxxxxxxxxxxxxxxxxx
<snip>
Remember that CH-E5-BIN is a binary halfword (two bytes). Therefore, although
the value is 'three digits' it can be accommodated into a single byte. In
fact, any value up to 255 would be OK... (It is only 'three digits' because
you are thinking in decimal :-))

What Pette says above is true AND FALSE. As the OP mentioned an IBM mainframe
compiler, this will totally depend upon what setting of TRUNC is specified - and
how the field is used. If one wants to be "totally safe" it is NEVER a "good
idea" to put a 3 (decimal) digit value into a field defined with "PIC 9(2)" -
regardless of USAGE (unless using an implementer defined usage that SAYS this is
OK, such as COMP-5 or COMP-X in some compilers).

--
Bill Klein
wmklein <at> ix.netcom.com


.



Relevant Pages

  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... ANSI X3.23-1985 has USAGE BINARY. ... If J can be made an independent item which the compiler can put wherever it ... has to be associated with a hardware device in SPECIAL-NAMES. ... the same object code file to share the same instantiations of its code ...
    (comp.lang.cobol)
  • Re: C a Dead Language
    ... It is a major fallacy to claim the if as abstract in all usage. ... Now the Visual 6.0 enforece predicate test the geniuses theory. ... Why test thinking when the goal was a compiler? ... When the castles fall the logical BASIC routine will power the nuke. ...
    (comp.lang.c)
  • repost: sumbol lookup error
    ... RAM usage caused by shared objuect is too much and we decided ... ARM compiler at linking stage. ... In order to collect the necessary symbols in the file, ... shouldn't linker catch all the missing symbols at ...
    (comp.unix.programmer)
  • Re: repost: sumbol lookup error
    ... RAM usage caused by shared objuect is too much and we decided ... ARM compiler at linking stage. ... In order to collect the necessary symbols in the file, ... are exported and in such a way, I removed all the unnecessy symbols in ...
    (comp.unix.programmer)
  • Re: C a Dead Language
    ... It is a major fallacy to claim the if as abstract in all usage. ... Now the Visual 6.0 enforece predicate test the geniuses theory. ... compiler, no matter what's the implementor, C will survive. ...
    (comp.lang.c)