Version 8.2.3
 —  Administration  —

Exit Programs

This section describes how to define and store exit programs.

It is the administrator's responsibility to ensure that user exit programs do not have adverse effects on Super Natural!

This section covers the following topics:


What are Exit Programs?

There are two kinds of exit programs in Super Natural:

Top of page

User Exits

User exits can be invoked from up to ten places within a transaction at run time. The user defines which exits he wants to use, the location and any parameters. An exit can be any of the following:

User exits which are Natural objects must be stored in the steplib SYSTEM or in the current user's private library.

Super Natural recognizes the exit type and automatically generates the relevant Natural statements such as FETCH RETURN, CALLNAT or PERFORM and passes parameters.

Note:
You can prevent the modification of exits in transactions in a public library or in transactions which will be used as a superfile using the LOCK command.

Writing User Exits

When you are writing a user exit program, consider the following points:

Program Type

An exit program must be one of the following:

Parameters

Parameters must correspond with the call of the external program as used in the CALL statement; or with the parameter list used in the Natural module

If the exit program requires parameters, the user must specify them manually using the Exit Specification function.

Connecting User Exits to a File

Start of instruction setTo connect a user exit program with a file

Informing Users

Do not forget to provide the users with the program names of the user exits available to them, and tell them which parameters are to be passed to the subprogram.

Storing User Exit Object Modules

Natural Objects

The object modules ofNatural programs, subprograms, subroutines, or maps can be stored as follows:

Note:
When you copy a transaction which uses user exits, you must make sure that the user exit object modules are available in the target environment as described above.

Non-Natural Programs

For information on storing object modules of external (non-Natural) programs, contact your Natural administrator or see the Natural documentation.

Top of page

System Exits

You use system exits to take control at a certain point in Super Natural. The following system exits are supplied with Super Natural in source code:

ENTRY Program invoked as entry routine for the Super Natural session.
EXIT Program invoked as exit routine when the Super Natural session is terminated.
SHEXIT Program which takes over if the user presses.
SNERRU Program invoked by error routine SNRTE. SNERRU can be modified to handle specific error conditions. For example, you can use SNERRU to give the user additional information or instructions when an error occurs.
SPRJEU Natural subprogram which is executed once for every job card prior to the submission of a batch job.
SPPARM Subprogram to define environment specific parameter settings. Parameters include:
The submission indicator for batch job submission (RJE or NPR).
Com-plete hardcopy support - default printer number generation or prompting for destination (default).
Common library prefix character - only change at installation.
Layout prefix character - only change at installation.

You can modify these user exits if required.

Top of page