HPlogo Using KSAM XL: 900 Series HP 3000 Computer Systems > Appendix A COBOL Intrinsics

CKCLOSE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

A call to CKCLOSE terminates file processing for the specified KSAM file.

   CALL "CKCLOSE" USING filetable, status 

When processing is completed, a KSAM file should be closed with a call to CKCLOSE. No further processing is allowed on the file until a CKOPEN procedure call opens the file.

CKCLOSE can be executed only for a file that is open.

Parameters

filetable

An 8 halfword record containing: the name of the file, its input/output type, access mode, the file number given the file when it was last opened, and a code indicating whether the previous operation on the file was successful and if so what it was. (Refer to Filetable Parameter discussion earlier in this section.)

status

One-halfword (two 8-bit characters) set to a pair of values upon completion of the call to CKCLOSE. It indicates whether or not the file was successfully closed and if not, why not. The left character is set to 0 if CKCLOSE is successful, to 9 if not. The right character is set to 0 if CKCLOSE is successful, to the file system error code if not. (Refer to Status Parameter discussion earlier in this section.)

Operation Notes

Upon successful completion of CKCLOSE, the file identified by filetable is no longer available for processing. Note that a KSAM file can be closed and then reopened in order to specify a different access mode or input/output type.

 

FINISH. 

  CALL "CKCLOSE" USING FILETABLE, STAT. 

  IF STATUS-KEY-1 = "9" THEN 

    CALL "CKERROR" USING STAT, RESULT 

    DISPLAY "CKCLOSE ERROR NO. ", RESULT; 

  ELSE DISPLAY "CKCLOSE SUCCESSFUL". 
Feedback to webmaster