FILE FILEIN
REC-IN 1 390 A
REC-ACC-NMBR 1 16 N
BYTE-CNTR W 9 P
FILE-CNTR W 6 N
* DUMMY-VAR W 1 A
FIVE-ACCNTS W 85 A
ACCNT-LINE FIVE-ACCNTS 17 A OCCURS 5 INDEX IND
ACCNT ACCNT-LINE +1 16 A
NUMBER-OF-STORED-ACC W 1 P
RECORD-NUMBER W 1 P VALUE 6
JOB INPUT FILEIN
DISPLAY 'TRACE 1'
BYTE-CNTR = BYTE-CNTR + FILEIN:RECORD-LENGTH
DISPLAY 'TRACE 2'
DISPLAY 'NUMBER-OF-STORED-ACC' NUMBER-OF-STORED-ACC
IF NUMBER-OF-STORED-ACC LT RECORD-NUMBER
NUMBER-OF-STORED-ACC = NUMBER-OF-STORED-ACC + 1
IND = NUMBER-OF-STORED-ACC
ACCNT(IND) = REC-ACC-NMBR
END-IF
REC-IN 1 390 A
REC-ACC-NMBR 1 16 N
BYTE-CNTR W 9 P
FILE-CNTR W 6 N
* DUMMY-VAR W 1 A
FIVE-ACCNTS W 85 A
ACCNT-LINE FIVE-ACCNTS 17 A OCCURS 5 INDEX IND
ACCNT ACCNT-LINE +1 16 A
NUMBER-OF-STORED-ACC W 1 P
RECORD-NUMBER W 1 P VALUE 6
JOB INPUT FILEIN
DISPLAY 'TRACE 1'
BYTE-CNTR = BYTE-CNTR + FILEIN:RECORD-LENGTH
DISPLAY 'TRACE 2'
DISPLAY 'NUMBER-OF-STORED-ACC' NUMBER-OF-STORED-ACC
IF NUMBER-OF-STORED-ACC LT RECORD-NUMBER
NUMBER-OF-STORED-ACC = NUMBER-OF-STORED-ACC + 1
IND = NUMBER-OF-STORED-ACC
ACCNT(IND) = REC-ACC-NMBR
END-IF
The program reads file and counts bytes.
On the record number "RECORD-NUMBER + 1" I have S0C7 in the statement:
BYTE-CNTR = BYTE-CNTR + FILEIN:RECORD-LENGTH
If I define any variable like DUMMY-VAR ( You could see it commented out) or I will comment out any of statements in IF block the ABEND disappears. There are many another code changes when it not abended.
My question is what causes S0C7 here.
Thanks!