A call to BKCLOSE terminates file processing for the specified KSAM file.
CALL BKCLOSE (filenum, status)
|
When processing is completed, a KSAM file should be closed with a call to BKCLOSE. No further processing is allowed on the file until a BKOPEN procedure call reopens the file.
BKCLOSE can be executed only for a file that is open.
Parameters |
 |
- filenum
A numeric variable containing the file number that identifies the file; this number was returned by the last call to BKOPEN. It should not be altered until the file is closed with a successful call to BKCLOSE. (Required parameter)
- status
A four-character string variable to which is returned a code that indicates whether or not the file was successfully closed and if not, why not. The first character is set to 0 if the close is successful, to another value if not. (Required parameter)
Operation Notes |
 |
After calling BKCLOSE, you should check the status parameter to determine if the file was closed successfully. A successfully closed file is no longer available for processing until it is reopened. Note that a KSAM file can be closed and then reopened in order to specify a different access mode or type of processing.
The BKCLOSE procedure does not remove the file from the system. To do this, you should use the PURGE command of KSAMUTIL or MPE/iX.
The example in Figure B-1 “Closing a KSAM File with BKCLOSE” closes a file identified by the file number in F. It then checks the status and prints a message if the status shows any code except the zero for successful completion.