After upgrading from a COBOL for AIX version prior to V4.1.1, the COBOL COBRTOPT command no longer parses an
entire EBCDIC input file. Why does it parse only the first record and just end as if it only has one record?
This used to work with the older compiler version such as V4.1.0.
The reason why the test case only reads 1 record, is because of a design change in COBOL for AIX, V4.1.1 (and later) when the FILESYS(RSD) file-system is specified.
Each record would be read by looking for the new line ('\n') delimiter.
RSD type data files are supposed to have this new line delimiter as mentioned in the link below:
If a corresponding test.dat file does not have the new line delimiters, it will only read 1 record and stop afterwards.
However, in COBOL for AIX, V4.1.0, the compiler used to check for the new line and if it didn't find one in the location where it was
expecting it, it would simply ignore it there and move on to the next record; and issue a FS=04. That's why it would work with older compiler versions.
There are two solutions to resolve this issue with V4.1.1 (and later):
1) In COBOL for AIX, V4.1.1 (and later), a new FILESYS(QSA) has been implemented to handle cases specifically for this scenario. A small code change would
also be required in your the test case.
SELECT IN-FILE ASSIGN TO RSD-INFILE
SELECT IN-FILE ASSIGN TO INFILE
and export COBRTOPT='FILESYS(QSA)'
Here is more documentation on QSAM:
2) Modify your test.dat file to include the new line delimiters (\n).
Hope this helps!