


A_MSSQL_FAST_ACCESS is a configuration variable that is set from your COBOL program. Files opened while this variable is set to a non-zero value will be optimized for forward sequential access.
Acucorp implemented this option to substantially improve the READ NEXT performance in some cases. For example, testing the Acucorp benchmark program iobench.cbl in three different ways, yielded the following results for the READ AND SKIP operation:
| No FAST_ACCESS: | 72.76 seconds |
| FAST_ACCESS, ROWCOUNT 0: | 148.88 seconds |
| FAST_ACCESS, ROWCOUNT 10: | 8.09 seconds |
For certain reporting programs, this option can dramatically improve performance. However, please note the following restrictions.
Files must be opened INPUT or opened IO with MASS-UPDATE. FAST_ACCESS gives a performance boost only when no locking is required. In files that allow locking, a record must be reread after being locked; this prevents an uninterrupted forward sequential traversal.
Files opened with FAST_ACCESS use a dedicated connection for reading from the file. Since connections are memory-intensive (both on the client, and on the server), the number of files opened with FAST_ACCESS should be kept to a minimum. In the event that opening a connection fails, the file open will still continue, but FAST_ACCESS mode will be disabled, with the following message appearing in the trace file:
FAST_ACCESS mode not available.
Also, a new connection technically uses a new concurrent Microsoft SQL Server license from Microsoft.
Files opened with FAST_ACCESS will not participate in transactions, and may even cause the runtime to hang if transactions are used, especially if the FAST_ACCESS file is updated within the transaction. We suggest that if you use transactions, you don't use FAST_ACCESS. At the minimum, if you use transactions, we suggest that you use FAST_ACCESS only for files open INPUT.
Files open with FAST_ACCESS cannot be read backwards. In other words, READ PREVIOUS will not work with FAST_ACCESS files. In fact, if you try to READ PREVIOUS on a file opened with FAST_ACCESS, you will get an error 9D,20.
The ANSI standard states that READ NEXT after a READ will return the next record. Some applications depend on this, and some applications just want to read dynamically from a file, and don't use the positioning facility. Because of this ambiguity, files that are open with FAST_ACCESS cannot be READ dynamically. If you try to READ on a file open with FAST_ACCESS, you will get an error 9D,20.
There are no restrictions on WRITE, REWRITE, and DELETE. However, these operations use the cursor-based connection, not the dedicated connection. This is the reason transactions may hang.
While the default value is "0" (off, false, no), this configuration variable can also take values of "On" (true, yes).