17 CFS User Exits

External routines can be called under CFS as:

a) User Options for evaluating the catalog entries according to special characteristics.

b) Variable Actions to perform special processing tasks on files, library elements or Job variables.

c) Action Codes to perform special processing tasks on files, library elements or Job variables as a customised Action Code.

d) Commands to perform special processing tasks for files, library elements or Job variables.

The CFS user can call an external User Option or a command routine as follows:

(module [,lib]) [ params]

Calling an external routine as a Variable Action is done as follows:

ONX(module [, lib]) [ params] | ON&(module [, lib]) [ params]

module Name of the module to be called (Module/CSECT Name).

lib Library in which the module is located.

Standard: CFSLIB

params optional parameters to be passed to the module when it is called, and which will control the execution of the routine.

Calling an external Action Code routine is done by entering the required Code in the Action Field.

This Action Code must first have been entered in a CFS-internal Action Code table before it will be correctly executed. Further information can be found in the source code of CFSMAIN, located in CFS.S.LMSLIB.

Calling conventions for external routines:

R1 Address of the parameter list

R13 Address of a 72 byte Save Area

R14 Return address in CFS

R15 Start address of the routine

Saving the registers should be achieved by following the standard conventions:

STM 14,12,12(13) (Start)

  ...

LM 14,12,12(13) (Return)

THe source code of the following routines is included in CFS.S.LMSLIB as examples of each of the different types of external routines:

a) FREE as an example of a User Option routine (Free Space).

b) CONV as an example of a user-specific Variable Action.

c) PREMOTE as an example of a user-specific Action Code (PD).

d) VSNSP as an example of a user-spcific CFS command.

VSNSP will display all VSNs occupied by a specified file, as well as the number of PAM pages occupied on each VSN by the file. The syntax is: (VSNSP) file.

Notes:

The expected parameter input for the above examples is documented in each sorce code.

To be recognised as such, user-defined Action Codes must be defined within the CFS system, in an Action Code table. The structure of the table element for the PD Action Code is described in the source code of CFSMAIN, located in CFS.S.LMSLIB.

User-specific message handling by the Connection handler can also be achieved. For further information, please contact our company, OPG.