Re: Setting A Hex Value in COBOL



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>,
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





.



Relevant Pages

  • Re: invoking a method
    ... The use of SET as shown here, will not work outside the Fujitsu Object COBOL ... invoke DBObject ... I will admit I have not worked on anyone else's Cobol compiler so I ... typical reference manual for a Cobol Compiler will have line and box based ...
    (comp.lang.cobol)
  • Re: C03 abend when omitting CEE.SCEERUN from JCL
    ... The AMODE, RMODE, RENT, and RES information are link-edit information, not ... "compiler option" information. ... VS Cobol Program is actually OS/VS Cobol (amblist shows 5740CB103 as ... Do you mean VS COBOL II or OS/VS COBOL? ...
    (bit.listserv.ibm-main)
  • Re: COBOL Compiler for Windows
    ... rebadged Micro Focus compiler. ... to run TSO/SPF on your mainframe. ... Or maybe he wants a mainframe emulation environment, ... Why would a small developer pay several thousand for a .NET COBOL ...
    (comp.lang.cobol)
  • Re: AIFCHANGELOGON
    ... a reference for the system, and programmers, to use system intrinsics. ... I don't know Walter Murray as maybe you do. ... there are few people on the planet who know HP's COBOL ... else in the ???INTR files the compiler would need to know. ...
    (comp.sys.hp.mpe)
  • Re: compile+link Fujitsu Linux
    ... has some problems for use in business programming. ... It is common for most of a large business application to be written in Cobol, ... chosen the compiler options and link parameters that work best for me. ... I keep telling you it's not my way, it's the Unix norm. ...
    (comp.lang.cobol)