The S$IO routine provides an interface to the sequential file handler. Calls to the routine require an operation code and a variable number of parameters, depending on the operation called. 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 S$IO, and should be checked only if S$IO returns an error condition.
CALL "S$IO" USING OP-CODE, PARAMETERS
Specifies the file handling routine to be performed. The following table lists each op-code and its corresponding operation. The operations are detailed below:
Code | Operation |
---|---|
1 | S-OPEN-FUNCTION |
2 | S-CLOSE-FUNCTION |
3 | S-MAKE-FUNCTION |
4 | S-READ-FUNCTION |
5 | S-WRITE-FUNCTION |
6 | S-REWRITE-FUNCTION |
7 | S-SEEK-FUNCTION |
The remaining parameters vary depending on the operation selected. They provide information and hold results for the operations specified. Parameters may be omitted from those operations that do not require them.
All parameters passed to S$IO are passed by reference. This applies even to parameters that are integer values in the corresponding file handling routines.
Except for the MAKE function, S$IO automatically terminates PIC X parameters with a LOW-VALUES byte.
You do not have to specify SYNC for level 01 or level 77 parameters because they are automatically synchronized by ACUCOBOL-GT.
The filesys.def COPY file contains many useful definitions for use with S$IO. It contains definitions for the S$IO op-codes as well as the F-ERRNO error values. It also incudes many useful pre-declared variables that are of the proper type and usage.
The behavior of this routine is affected by the setting of the FILENAME_SPACES configuration variable that may or may not allow spaces in a file name. See the documentation on FILENAME_SPACES in Appendix H for information about the terminating character for path names.
The runtime configuration variables FILE_PREFIX and FILE_SUFFIX are ignored by the S$IO routine.