I am using CA Realia Cobol II on a pc. I have 2 files. Primary file(R2) is ASCII read sequentially. 2nd file(R1) is a VSAM file, 30 bytes long, 14 byte key at offset 0.
Here is a portion of the file control code:
SELECT R2 ASSIGN TO R2
ACCESS IS SEQUENTIAL
FILE STATUS IS FILE-STATUS.
SELECT R1 ASSIGN TO R1
FILE STATUS IS FILE-STATUS.
Here is a portion file section code:
FD R2
LABEL RECORDS ARE STANDARD.
01 R2-RECORD.
05 R2-PHYSICAL-KEY.
10 R2-TREATY PIC X(11).
10 R2-UW-YEAR PIC 999.
Etc.
FD R1
LABEL RECORDS ARE STANDARD.
01 R1-RECORD PIC X(30).
05 R1-PHYSICAL-KEY.
10 1-TREATY PIC X(11).
10 R1-UW-YEAR PIC 999.
10 R2-PROFIT-CENTER PIC XX.
10 R2-SUBCLASS PIC X.
10 R2-SCR-TYPE PIC X.
10 R2-OTHER PIC X(12).
Here is the code to lookup record in second file:
MOVE LOW-VALUES TO R1-PHYSICAL-KEY.
MOVE R2-TREATY TO R1-TREATY
MOVE R2-UW-YEAR TO R1-UW-YEAR.
READ R1.
Using interactive debug, I can look at the fields subclass,profit center,etc, after the READ statement. They do not contain what I know is in the record. The field R2-SCR-TYPE shows a value of “:” instead of “3”. I know what’s in the record because I displayed it via the REALFED utility. What is wrong with my code? I don’t seem to be actually reading the record. Please help.
Here is a portion of the file control code:
SELECT R2 ASSIGN TO R2
ACCESS IS SEQUENTIAL
FILE STATUS IS FILE-STATUS.
SELECT R1 ASSIGN TO R1
FILE STATUS IS FILE-STATUS.
Here is a portion file section code:
FD R2
LABEL RECORDS ARE STANDARD.
01 R2-RECORD.
05 R2-PHYSICAL-KEY.
10 R2-TREATY PIC X(11).
10 R2-UW-YEAR PIC 999.
Etc.
FD R1
LABEL RECORDS ARE STANDARD.
01 R1-RECORD PIC X(30).
05 R1-PHYSICAL-KEY.
10 1-TREATY PIC X(11).
10 R1-UW-YEAR PIC 999.
10 R2-PROFIT-CENTER PIC XX.
10 R2-SUBCLASS PIC X.
10 R2-SCR-TYPE PIC X.
10 R2-OTHER PIC X(12).
Here is the code to lookup record in second file:
MOVE LOW-VALUES TO R1-PHYSICAL-KEY.
MOVE R2-TREATY TO R1-TREATY
MOVE R2-UW-YEAR TO R1-UW-YEAR.
READ R1.
Using interactive debug, I can look at the fields subclass,profit center,etc, after the READ statement. They do not contain what I know is in the record. The field R2-SCR-TYPE shows a value of “:” instead of “3”. I know what’s in the record because I displayed it via the REALFED utility. What is wrong with my code? I don’t seem to be actually reading the record. Please help.