Command reference / db

CLOSE

Close Database File

Closes a database file in a CL program that a Receive File (RCVF) command opened implicitly, so that the next RCVF reads from the first record again.

Allowed environments: *ALL. Use within a CL program. Positional parameters: 1.

Parameters

OPNID Open file identifier

Specifies the open file identifier of the file to close. *NONE closes the file that was declared without an OPNID. The default is *NONE.

Type
*NAME
Required
No
Default
*NONE
Length
10
Case
Uppercase

Suggested / special values: *NONE

Examples

DCLF FILE(MYLIB/ITEMS)
RCVF
MONMSG CPF0864 EXEC(GOTO DONE)
CLOSE
RCVF
DONE: ENDPGM

CLOSE ends the open that RCVF started, so the second RCVF reads the first record of the file again.

IBM command documentation

Generated from os/cl/catalog/CLOSE.json and os/cl/help/CLOSE.json.