Re: Setting A Hex Value in COBOL
- From: docdwarf@xxxxxxxxx ()
- Date: Wed, 30 May 2007 19:02:26 +0000 (UTC)
In article <%yj7i.172509$nh4.82579@xxxxxxxxxxxx>,
gary <garyinri@xxxxxxxxx> wrote:
I have to modify an old COBOL program which probably hasn't been touched
since the mid-90's.
Oh, come now... it probably saw some Y2K remediation, check the date on
the load module in Prod.
[snip]
01 CH-NL-BIN PIC S9(4) COMP VALUE +21.
01 FILLER REDEFINES CH-NL-BIN.
02 FILLER PIC X.
02 CH-NL PIC X.
01 CH-FF-BIN PIC S9(4) COMP VALUE +12.
01 FILLER REDEFINES CH-FF-BIN.
02 FILLER PIC X.
02 CH-FF PIC X.
01 CH-1D-BIN PIC S9(4) COMP VALUE +29.
01 FILLER REDEFINES CH-1D-BIN.
02 FILLER PIC X.
02 CH-1D PIC X.
01 CH-56-BIN PIC S9(4) COMP VALUE +86.
01 FILLER REDEFINES CH-56-BIN.
02 FILLER PIC X.
02 CH-56 PIC X.
01 CH-31-BIN PIC S9(4) COMP VALUE +49.
01 FILLER REDEFINES CH-31-BIN.
02 FILLER PIC X.
02 CH-31 PIC X.
Hmmmmm... smells older than the 1990s. My guess is that NL is a NewLine
and FF is a FormFeed.
My question is this. I need to add a field which would end up containing a
X'E5'. The decimal equivalent is +229. Since the value of the field is
3-digits, will it still "fit" into the PIC X field?
Wait, now I'm confused... X'E5' is not '3-digits', it is a single byte.
Would it look something
like this?
01 CH-E5-BIN PIC S9(4) COMP VALUE +229.
01 FILLER REDEFINES CH-E5-BIN.
02 FILLER PIC X.
02 CH-E5 PIC X.
I'm assuming that this new E5 code is supposed to... *do* something, in a
manner similar to the other codes. This indicates that there's at least
two ways to test it, either by debugging or just sending off a 'let's go
see!' run.
This is some old MVS COBOL II code. Is there actually a better way to be
performing this function? Is there anything like MOVE X'E5' to CH-E5?
That's supported in some dialects of COBOL, aye. Is there something that
prevents you from seeing what kind of compile errors it might throw?
DD
.
- Follow-Ups:
- Re: Setting A Hex Value in COBOL
- From: gary
- Re: Setting A Hex Value in COBOL
- References:
- Setting A Hex Value in COBOL
- From: gary
- Setting A Hex Value in COBOL
- Prev by Date: Setting A Hex Value in COBOL
- Next by Date: Re: FTPing COMP-3 data from mainframe to UNIX
- Previous by thread: Setting A Hex Value in COBOL
- Next by thread: Re: Setting A Hex Value in COBOL
- Index(es):