Problem:
File status 9/194 "File size too large" was reported against a sequential file. The file size on disk was 7.5 gig. The file handler configuration file included:
[XFH-DEFAULT]
FILEMAXSIZE=8
This FILEMAXSIZE=8 setting should allow the file handler to handle sequential files larger than 4 gig, but for some reason the error was still occuring.
Solution:
The environment variable EXTFH is supposed to point to the location of the file handler configuration file. In the environment in which the application ran, EXTFH did appear to be set pointing to the correct file handler configuration file. But when we added code to the COBOL program to reveal the run-time value of EXTFH, we learned that a script used to trigger the application had modified the value of EXTFH, so by the time the COBOL program was invoked, EXTFH was not set correctly. Here is the technique used to reveal the run-time value of this environment variable:
Insert the following line of code at the top of the procedure division of the COBOL program, then re-compile the program:
call "SYSTEM" using "sh extfh-check.sh" & x"00".
Then create a file in the current working directory named extfh-check.sh, and insert this one line:
cat $EXTFH > extfh-out.txt 2>&1
Then run the program. Afterward, check the file on disk named extfh-out.txt. In this case it showed that EXTFH was not set correctly. After modifying the script used to trigger the application, so it set EXTFH correctly, the error 9/194 "File size too large" no longer appeared and the problem was solved.