Re: Setting A Hex Value in COBOL
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Wed, 30 May 2007 19:55:09 GMT
The bottom-line answer to your original question is that
Yes, the VS COBOL II compiler (what I think you mean by "MVS COBOL II) compiler
supports hex-literals.
HOWEVER, only if you are using the NOCMPR2 compiler option. It looks like you
have an "old" OS/VS COBOL program that may have been recompiled with VS COBOL
II. You will need to check what compiler options were used (in 1994) and which
version of the compiler was used.
FYI,
The information is online. For example, check out:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igyl1101/1.1.1.11
--
Bill Klein
wmklein <at> ix.netcom.com
"gary" <garyinri@xxxxxxxxx> wrote in message
news:0sk7i.362283$2Q1.84574@xxxxxxxxxxxxxxx
DD,
Program was last modified on 6-8-1994 and probably was originally developed
in the 80's. No date handling in the code so no Y2K remediation was needed.
Yes, the FF an NL do represent the codes for a NewLine and a FormFeed. As
for the "3-digits", I was referring to the 229, not the E5.
The reason I was trying to gather a little info first was that we have to
submit requests to our DBA group to get something complied and copied.
There are times that things don't get turned around too quickly, so I'm
trying to minimize the number of requests I need to make. But yes, at this
point, I plan on just throwing the code out there and testing it with a
"let's go see" run.
Gary
<docdwarf@xxxxxxxxx> wrote in message news:f3kho1$63n$1@xxxxxxxxxxxxxxxxxxxx
In article <%yj7i.172509$nh4.82579@xxxxxxxxxxxx>,a
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
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: Howard Brazee
- Re: Setting A Hex Value in COBOL
- From: CG
- Re: Setting A Hex Value in COBOL
- References:
- Setting A Hex Value in COBOL
- From: gary
- Re: Setting A Hex Value in COBOL
- From:
- Re: Setting A Hex Value in COBOL
- From: gary
- Setting A Hex Value in COBOL
- Prev by Date: Re: interview questions
- 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
|