KSAM/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 4 USING KSAM FILES IN SPL PROGRAMSKSAM FILE SYSTEM INTRINSICS |
|
The Multi-Programming Executive Operating System (MPE) provides a set of procedures, known as intrinsics. A subset of these intrinsics makes up the file system, a set of procedures used to manipulate files. KSAM files are processed using these same intrinsics with the following exceptions: seven new intrinsics are added for KSAM files, and four of the file system intrinsics do not apply to KSAM files. (Refer to Table 4-1 “KSAM File System Intrinsics” for a list of the KSAM file system intrinsics.) Table 4-1 KSAM File System Intrinsics
An intrinsic used in an SPL program must be declared at the beginning of the program following all other declarations. There are two ways to declare an intrinsic: one is to make an external procedure declaration, and the other is to use the INTRINSIC declaration. Since declaring an external procedure is a long process, you can save space and time by using the INTRINSIC declaration as follows:
You name all the intrinsics used in your program in the intrinsicname list. When more than one intrinsic is named, the names must be separated by commas. You call an intrinsic by writing the intrinsic name followed by a list of parameters enclosed in parentheses. These parameters must be in the order established for each intrinsic as shown in the intrinsic formats later in this section. Every parameter that is specified as a variable or an array must be declared before the intrinsic is called. The formats that describe intrinsics define the variable or array type of each parameter; specify whether it can be passed by value or must be passed by reference; and indicate whether any parameters are optional and if so which ones. In summary, to call an intrinsic from an SPL program:
Table 4-1 “KSAM File System Intrinsics” is provided to give an overview of the intrinsics available for accessing KSAM files. In this table, the intrinsics are organized into functional groupings. In the body of this section, however, the intrinsic descriptions are in alphabetic order so that they may be referenced easily. In Table 4-1 “KSAM File System Intrinsics”, an asterisk (*) preceding an intrinsic name indicates that this intrinsic applies only to KSAM files. A bracket around an intrinsic name indicates that the intrinsic should not be used for KSAM files. Intrinsic format is illustrated below using FCHECK as an example.
Optional parameters are indicated by an underline under each option and by the superscript O-V. The parameter type and whether it is passed by value is shown by the superscript over each parameter. Possible parameter types are:
Integer,logical and double type parameters can be passed by value. This means that the actual value can be specified in the intrinsic call instead of a variable or array name. When a parameter is passed by reference (default for all parameter types), the address in the caller's data area of the named variable or array is made available to the intrinsic. If the variable or array is modified by execution of the intrinsic, the storage in the caller's data area is updated. When a parameter is passed by value, the corresponding variable in the calling routine is unchanged. If any parameters can be omitted, the superscripts that describe individual parameters are followed by the superscript O-V, option variable. O-V means that at least one parameter in the list is optional. Since all parameters are recognized by their position in the list, a parameter may be omitted but its preceding comma must be included. If one or more parameters are omitted from the end of the list, this is indicated by placing the terminating parenthesis after the last specified parameter. For example:
|