OSCLOSE

OSCLOSE command closes a sequential file that you have opened with the OSOPEN or OPENSEQ command.

COMMAND SYNTAX

    OSCLOSE file.var [ ON ERROR statements ]

SYNTAX ELEMENTS

file.var specifies the file to close.

ON ERROR statements specifies statements executed when the OSCLOSE statement fails with fatal error, I/O error, or JBASE cannot find the file.

If you do not specify the ON ERROR clause and a fatal error occurs, the program will enter the debugger.

STATUS Function Return Values

After you execute OSCLOSE, the STATUS function returns either 0 or a failure code.

CodeDescription
0Closes the file successfully.
1Fails to write the file.

EXAMPLE

In the following example, the program statement closes the file opened to MYPIPE file variable.

    OSCLOSE MYPIPE
Last update: Sat, 16 Jul 2022 15:34