An operation code and some number of additional parameters (depending on the operation called) are passed to the routine. The return code is set automatically after the call. The external variable F-ERRNO is set according to any errors found. F-ERRNO may not be reset on entry to I$IO, and should be checked only if I$IO returns an error condition.
Specifies the file handling routine to be performed. This table shows which operation corresponds to each operation code. The operations are detailed in the description below:
Code | Operation |
---|---|
1 | OPEN-FUNCTION |
2 | CLOSE-FUNCTION |
3 | MAKE-FUNCTION |
4 | INFO-FUNCTION |
5 | READ-FUNCTION |
6 | NEXT-FUNCTION |
7 | PREVIOUS-FUNCTION |
8 | START-FUNCTION |
9 | WRITE-FUNCTION |
10 | REWRITE-FUNCTION |
11 | DELETE-FUNCTION |
12 | UNLOCK-FUNCTION |
13 | REMOVE-FUNCTION |
14 | SYNC-FUNCTION |
15 | EXECUTE-FUNCTION |
16 | BEGIN-FUNCTION |
17 | COMMIT-FUNCTION |
18 | ROLLBACK-FUNCTION |
19 | RECOVER-FUNCTION |
21 | IN-TRANSACTION-FUNCTION |
The remaining parameters vary depending on the operation selected. They provide information and hold results for the operations specified. All parameters are passed by reference. Parameters may be omitted from those operations that do not require them.
All parameters passed to I$IO are passed by reference. This applies even to parameters that are integer values in the corresponding file handling routines. All numeric parameters should be passed to I$IO as SIGNED-SHORT values. The I$IO routine provides any necessary addressing conversions. Note that a parameter must be in the correct format for its type. Parameters that are PIC X must be terminated by a LOW-VALUES character.
Except for the MAKE function, I$IO will automatically terminate any PIC X parameters with a LOW-VALUES byte for you. Also, you do not have to specify SYNC for level 01 or level 77 parameters because they are automatically synchronized by ACUCOBOL-GT.
The file filesys.def is a COBOL COPY file that contains many useful definitions for use with I$IO. It contains definitions for the I$IO codes along with the F-ERRNO error values and many useful pre-declared variables that are of the proper type and usage.
The behavior of this routine is affected by the FILENAME_SPACES configuration variable. The value of FILENAME_SPACES determines whether spaces are allowed in a file name.