Version 8.2.3
 —  User's Guide  —

Using User Exit Programs

This section describes user exit programs.

This section covers the following topics:


What are User Exit Programs?

User exit programs are programs stored outside Super Natural which can be invoked and executed when a Super Natural transaction is run. A user exit program can be a Natural object (program, sub-program, sub-routine or map) or a Natural-callable program stored outside Natural. Super Natural enables the end user to invoke user exit programs from selected locations within one or more transactions.

User exit programs are usually written by the Super Natural administrator and can be used in the following ways:

Once a user exit program has been activated, it is carried out each time the transaction is run or a particular file is accessed.

Your administrator will tell you the following:

Top of page

Activating User Exit Programs

You can activate a user exit program whilst adding or modifying a transaction.

Start of instruction setTo activate a user exit program

Start of instruction setTo activate an external program

Start of instruction setTo activate a Natural object

  1. Type its name in the Exit Program column.

  2. Mark the Natural Object column next to the exit location you require.

    If you enter the name of a Natural object which doesn't exist, a window appears which asks if you to confirm the entry. If you enter "N", the name is removed from the Exit Program column.

    If you enter "Y", you can continue and either write or obtain access to the program later.

Note:
You must write or obtain access to the program before you can run the transaction.

Optional:

Start of instruction setTo pass values from your transaction to the external program

  1. Mark the Parameter column at the relevant exit location.

  2. Press Enter.

    The Exit Parameter window appears with a selection list of the fields, which you can use as parameters in the external program.

    At exit location 1, no fields are available.

    At exit locations 2 and 10, only user fields and dynamic input fields are available. If the transaction contains no user fields or dynamic input fields, the Parameter list is protected next to these exit locations.

    At exit locations 3 through 9, all the fields which have been read by that point in the transaction are available.

    Multiple-value fields and periodic groups are not available.

  3. Mark the values you want to be passed to the external program using numbers from 1 to 40 to specify the sequence.

  4. Press Enter.

    You can now continue creating or modifying your transaction.

    You can specify more than one user exit program for a transaction.

Top of page

Deactivating User Exit Programs

If a user exit program is already defined for a transaction or a file, you do not have to use it as long as it has not been locked. For example, your administrator may have activated a user exit program to be used each time a particular file is accessed.

You can deactivate user exit programs whilst creating or modifying a transaction:

Start of instruction setTo deactivate a user exit program

  1. Issue the USEREXIT command.

    The Exit Specification screen appears.

  2. Overtype existing entries with blanks or with new user exit specifications.

  3. Press Enter.

    The user exit is deactivated.

Top of page

Locking User Exit Locations

If you lock a user exit location, the user exit specifications defined there can never be changed. For example, you can use this function when you copy a transaction into a common library to make sure that the user exit programs are used. You can also lock an exit location if you don't want it to be used.

Start of instruction setTo lock user exit specifications

Start of instruction setTo lock an exit location

  1. Mark the Lock column next to it.

  2. Press Enter.

    The Lock Exit confirmation window appears for each exit to be locked.

Once you have saved a transaction with a lock in it, even the administrator cannot override the lock!

Top of page