CBL_CHECK_FILE_EXIST2 checks whether a file exists or not. The difference between the CBL_CHECK_FILE_EXIST subroutine and this subroutine is that this subroutine can support a file name containing a space.
Specification
01 file-name PIC X(n). 01 file-details. 02 file-size PIC 9(18) BINARY. 02 file-date. 03 days PIC 9(4) BINARY. 03 months PIC 9(4) BINARY. 03 years PIC 9(4) BINARY. 02 file-time. 03 hours PIC 9(4) BINARY. 03 minutes PIC 9(4) BINARY. 03 seconds PIC 9(4) BINARY. 03 m-secs PIC 9(4) BINARY. 01 status-code PIC S9(4) COMP-5.
CALL "CBL_CHECK_FILE_EXIST2" USING file-name file-details RETURNING status-code.
Interface
Specifies the name of the file to be checked. If no path name is specified, the current directory is assumed. The end of the file name is indicated by a null character. The maximum size of the file name is 255.
Specifies the area to store the size of the file.
Specifies the area to store the creation date of the file.
Specifies the area to store the creation time of the file.
Return code
The return code is set in the status-code specified in the RETURNING clause.
0: Successful
Other than 0: Failure