Re: Hexadecimal Input Files
- From: docdwarf@xxxxxxxxx ()
- Date: Mon, 26 Jun 2006 14:47:35 +0000 (UTC)
In article <1151331823.840604.30880@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Stacy Kay <stacykw85@xxxxxxxxxxx> wrote:
I guess I didn't give enough information. I am an intern this summer. I
have already finished a program in Assembler. What my task is, is to
convert that program to COBOL. I have had two semesters of COBOL class
experience.
Some familiarity, then... well, that's a start.
The format of the input file I am to use is in
hexadecimal.
Ummmmm... maybe what the difficulty here is a matter of terminology.
Usually when a COBOL programmer refers to 'the format of a file' what is
indicated is the layout of the records, found either in the FD or in the
WORKING-STORAGE SECTION as the target of a READ (filename) INTO. Without
that one is usually reduced to READing a file into a field defined as a
simple alphanumeric and 'making sense' of the results by use of reference
modification. For example:
FD INFILE.
01 INFILE-REC PIC X( ).
....
WORKING-STORAGE SECTION.
....
01 WS-INFILE-REC.
05 WS-INFILE-LNAME PIC X(25) VALUE SPACES.
05 WS-INFILE-FNAME PIC X(20) VALUE SPACES.
05 WS-INFILE-MI PIC X(01) VALUE SPACES.
05 WS-INFILE-EMPNO PIC 9(09) VALUE ZEROES.
05 WS-INFILE-DPTNO PIC X(05) VALUE SPACES.
05 WS-INFILE-MGRNO PIC 9(09) VALUE ZEROES.
....
PROCEDURE DIVISION.
....
READ INFILE INTO WS-INFILE-REC
AT END SET NO-MORE-INFILE TO TRUE.
After this READ is successfully executed both INFILE-REC and WS-INFILE-REC
contain the same data. One can refer to WS-INFILE-DPTNO or
INFILE-REC(55:5) and the data will be the same; a COBOL programmer would,
in my experience, refer to the 'format' as being WS-INFILE-REC.
Where is a similar structure to be found for the file you will be using?
I just haven't had this experience before with this
format.
With good reason... one of the advantages of COBOL is that when (not if)
the program blows up at 2:am and Ops calls you then you will have an
easier time making sense of (and repairing) WS-INFILE-DEPTNO than
INFILE-REC(55:5).
I've read it before in a JCL dump, but just haven't used it.
Also, I am working on a mainframe environment.
With 'JCL' and 'mainframe' being mentioned I will conclude that you are
working in an IBM-compatible environment... this, also, is helpful to
know.
I didn't want to have
someone do my work. I just wanted ideas or even just information about
the relationship between COBOL using hexadecimal numbers. I've looked
in some of my mentor's manuals, but nothing goes too deep on this
subject.
Once again, 'hexadecimal numbers' are used in different ways... compare
the differences between what results from
01 NUM-COMP PIC S9(8) COMP VALUE +123456.
.... and ...
01 NUM-COMP3 PIC S9(8) COMP-3 VALUE +123456.
DD
.
- References:
- Hexadecimal Input Files
- From: Stacy Kay
- Re: Hexadecimal Input Files
- From:
- Re: Hexadecimal Input Files
- From: Stacy Kay
- Hexadecimal Input Files
- Prev by Date: can't invoke ISPEDIT through REXX
- Next by Date: Re: Hexadecimal Input Files
- Previous by thread: Re: Hexadecimal Input Files
- Next by thread: Re: Hexadecimal Input Files
- Index(es):
Relevant Pages
|
|