Why do I get a compile error "--S: Invalid open mode" on an OPEN I-O of an ORGANIZATION LINE SEQUENTIAL file?
In our experience it is rare to find COBOL programs that use OPEN I-O with ORGANIZATION LINE SEQUENTIAL files. The following limitations significantly reduce the usefulness of this combination:
START statement cannot be used
READ PREVIOUS cannot be used
The only function of REWRITE or DELETE is to replace or delete the last read record when reading forward through the file
For best performance and to take advantage of automatic Unicode conversion, the current implementation for LINE SEQUENTIAL files uses the JRE classes java.io.FileInputStream for OPEN INPUT and java.io.FileOutputStream for OPEN OUTPUT.
In order to support OPEN I-O and REWRITE on an ORGANIZATION LINE SEQUENTIAL file, the implementation would need to be modified to use the java.io.RandomAccessFile class instead.
This is feasible and Veryant will implement it if required. However, experience so far has shown that programs can be easily modified so they do not require this feature.
If the program does not update the file with REWRITE or DELETE, then the OPEN can be changed from OPEN I-O to OPEN INPUT or to OPEN OUTPUT depending on whether the program READs from or WRITEs to the file.
Otherwise, you can change the ORGANIZATION to BINARY SEQUENTIAL and add code to handle the carriage returns.
Please notify your Veryant representative if you determine that this feature is critical and that you cannot use the workarounds.
by: Veryant Support
This question has been viewed 8580 times so far.
Here to View all the questions in isCOBOL General
There are no attachment file(s) related to this question.
There are no user comments for this question. Be the first to post a comment. Click Here