HPlogo Using KSAM XL and KSAM 64 > Chapter 9 KSAM Intrinsics

FCLOSE

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 4 ♥
E0394 Edition 3

Syntax Parameters Operation Notes Condition Codes

Terminates access to a file on any device.

Syntax



          I16V     I16V         I16V
  FCLOSE (filenum, disposition, securitycode);

Parameters


filenum

16-bit signed integer by value (required)

Passes the file number of the file to be closed.

disposition

16-bit signed integer by value (required)

Passes the disposition of the file, significant only for files on disk and magnetic tape.


NOTE: This disposition can be overridden by a corresponding parameter in a FILE command entered prior to program execution.

The disposition options are:

Bits

Value/Meaning

13:3

Domain disposition:

000

No change. The disposition remains as it was before the file was opened. If the file is new, it is deleted by FCLOSE; otherwise, the file is assigned to the domain it belonged to previously. An unlabeled tape file is rewound and a labeled tape is rewound and unloaded.

001

Close as a permanent file. If the file is a disk file, it is saved in the system file domain. A new or old temporary file on disk has an entry created for it in the system file directory. If a file of the same name already exists in the directory, an error code is returned and the file remains open. If the file is a permanent file on disk, this domain disposition has no effect.

010

Close as a temporary job file (rewound). The file is retained in your temporary (job/session) file domain and can be requested by any process within your job/session. If the file is a disk file, the file name is checked.If a file of the same name already exists in the temporary file domain, an error code is returned and the file remains open.

011

Close as a temporary job file (not rewound). This option has the same effect as domain disposition 010, except that tape files are not rewound.

100

Release the file. The file is deleted from the system.

101

Makes a permanent standard disk file temporary (valid only for standard disk files with either fixed-length, variable-length, or undefined-length record formats). The file is removed from the permanent file directory and inserted into the TEMPORARY file directory. (PM capability is required for this option.)

11:2

Disk space disposition (valid only for standard disk files with either fixed-length, undefined-length, or variable-length record formats):

00

Does not return any disk space allocated beyond the end-of-file marker.

01

Returns any disk space allocated beyond the end-of-file (EOF) marker to the system. The EOF becomes the file limit; records cannot be added to the file beyond the EOF.

10

Returns any disk space allocated beyond the end-of-file (EOF) marker to the system. The file limit remains the same; records can be added to the file beyond EOF, up to the file limit. The disk space disposition takes effect on each FCLOSE.

0:11

Reserved for MPE/iX.

securitycode

16-bit signed integer by value (required)

Returns the type of security initially applied to the file (significant for new permanent files only). The valid options are:

Value

Meaning

0

Unrestricted access; can be accessed by any user, unless prohibited.

1

Private file creator security; can be accessed only by the creator.

Operation Notes


FCLOSE deletes buffers and control blocks where the process accessed the file. It also deallocates the device where the file resides, and it can change the disposition of the file. If FCLOSE calls are not issued for all files opened by the process, the calls are issued automatically by MPE/iX when the process terminates.

Condition Codes


CCE

Request granted.

CCG

Not returned.

CCL

Request denied. The file was not closed; an incorrect filenum was specified, or another file with the same name and disposition exists.

Refer to this intrinsic in the MPE/iX Intrinsics Reference Manual for other codes pertaining to KSAM files.




FCHECK


FCONTROL