contents.gifindex.gifprev1.gifnext1.gif

2.7.5 File Handling Options

Some COBOL compilers do not abort when a file error occurs and there is no Declarative to handle it. If you desire this behavior, set the configuration entry ERRORS-OK to "1".


CAUTION: When this is set, any file error that would normally cause ACUCOBOL-GT to abort will allow processing to continue. This means that if you set ERRORS-OK to "1" you will not get the usual error reporting--under most circumstances this is undesirable.

Some compilers also automatically create files when they are opened for I/O or EXTEND, if the files are missing. You can simulate this behavior by setting EXTEND-CREATES to "1" if you want to create files opened for EXTEND and setting IO-CREATES to "1" to create files opened for I/O.

RM/COBOL version 2 automatically closes all files except print files when a program executes an EXIT PROGRAM statement. By default, ACUCOBOL-GT does not do this, because it is a violation of the ANSI standard. If the configuration variable CLOSE-ON-EXIT is set to 1, then this behavior is emulated by runcbl. You can also set this variable to 2 to cause all files (including print files) to be closed when a program exits. Setting the variable to zero resets this option.

RM/COBOL version 2 also automatically causes a page eject when a print file is closed unless the WITH NO REWIND option is used on the CLOSE statement. The configuration variable PAGE-EJECT-ON-CLOSE can be set to "1" to cause this behavior. Setting it to "0" causes the normal behavior of not ejecting a page.

You can improve the performance of indexed files that are opened WITH LOCK by setting the configuration variable MASS-UPDATE to 1. This causes ACUCOBOL-GT to treat these files as if they were opened with the MASS-UPDATE phrase specified. For details on this phrase, see the section 6.1.6.2, "Using MASS-UPDATE" in this User's Guide.

Sort files

The SORT verb often makes use of temporary files. By default these files are stored in the current directory. You can specify an alternate directory to hold the sort files by setting the configuration variable SORT-DIR to the desired directory. This value is treated as a prefix, so any trailing directory syntax (such as "/") is required. You can improve the performance of the SORT verb by placing the temporary files on a fast device. Care should be taken, however, that the device has enough free space to hold twice the size of the data to be sorted.

Carriage control

RM/COBOL handles carriage-control characters in a line sequential file differently on different systems. By default, both ACUCOBOL-GT and RM/COBOL-85 remove carriage-control characters from input records for line sequential files. This is the ANSI standard. RM/COBOL version 2, however, does not remove form-feed characters on MS-DOS machines and does not remove form-feed or carriage-return characters on UNIX systems. Some existing RM/COBOL version 2 programs depend on this behavior.

ACUCOBOL-GT can optionally retain any or all of these characters in the input record. If the configuration variable CARRIAGE-CONTROL-FILTER is set to "1", then form-feed characters will be retained in the input record. If it is set to "2", then carriage-return characters will be retained. If it is set to "4", then line feeds will be retained. You may specify combinations of characters to retain by adding their corresponding values together. For example, specifying "6" causes carriage-returns and line feeds (2 plus 4) to be retained. Setting the variable to zero causes the default action of removing all three characters. Note that on VMS systems, carriage control information is not placed directly into data records and is instead maintained separately. For this reason, the CARRIAGE-CONTROL-FILTER setting has no effect on VMS systems and should not be considered portable to those machines.

Device locking

Finally, users on UNIX systems who want to make use of runcbl's automatic device locking facility may set the variable LOCK-DIR to the desired lock directory. This process is covered in detail in Chapter 6 of this User's Guide.

There are other configuration options that can affect file operations and performance. See Book 4, Appendix H, "Configuration Entries," for a complete listing of configuration options.