Re: Setting A Hex Value in COBOL
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Thu, 31 May 2007 05:01:50 GMT
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5c6j97F2ve8jcU1@xxxxxxxxxxxxxxxxxxxxx
<snip>
Remember that CH-E5-BIN is a binary halfword (two bytes). Therefore, althoughWhat Pette says above is true AND FALSE. As the OP mentioned an IBM mainframe
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 :-))
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
.
- Follow-Ups:
- Re: Setting A Hex Value in COBOL
- From: Pete Dashwood
- Re: Setting A Hex Value in COBOL
- From:
- Re: Setting A Hex Value in COBOL
- References:
- Setting A Hex Value in COBOL
- From: gary
- Re: Setting A Hex Value in COBOL
- From: Pete Dashwood
- Setting A Hex Value in COBOL
- Prev by Date: COBOL Certifications
- Next by Date: Re: Setting A Hex Value in COBOL
- Previous by thread: Re: Setting A Hex Value in COBOL
- Next by thread: Re: Setting A Hex Value in COBOL
- Index(es):
Relevant Pages
|
|