Top
NetCOBOL V11.0 CBL Subroutines User's Guide
FUJITSU Software

4.4 CBL_CHECK_FILE_EXIST2

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

Parameter data definition
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.
Calling format
CALL "CBL_CHECK_FILE_EXIST2"
     USING file-name
           file-details
     RETURNING status-code.

Interface

file-name

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.

file-size

Specifies the area to store the size of the file.

file-date

Specifies the area to store the creation date of the file.

file-time

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.

status-code
  • 0: Successful

  • Other than 0: Failure