SETUP

#### Search Results

Search

# SETUP

`SETUP` [application-name] [command-name] [I]

This command is used to define applications to which control is to be returned using the `RETURN` command. This allows you to easily transfer from one application to another during a Natural session.

This document covers the following topics:

- SETUP Syntax Explanation

- SETUP/RETURN Example

Application programming interface: `USR1026N`. See SYSEXT - Natural Application Programming Interfaces in the Utilities documentation.

## SETUP Syntax Explanation

The command syntax and the parameters that can be issued with the `SETUP` system command are explained below. If a parameter is to be omitted, you may use the input delimiter character to mark the beginning of the following parameter(s).

`SETUP` | If `SETUP` is issued without parameters, a menu will be displayed for the purpose of entering the command information.
`application-name` | The name of the application to which control is to be returned. A maximum of 8 characters may be used (A8). If application-name is blank, a `LOGON` command will not be issued. This permits multiple return points within the same application. If application-name is "*", the current setting of the system variable `*LIBRARY-ID` (that is, at the time `SETUP` is issued) is used to create the `LOGON` command when `RETURN` is issued.
`command-name` | The name of the command which is to be executed when control is returned to the application. A maximum of 60 characters may be used (A60). If command-name is blank, no command will be issued after the `LOGON`. This is useful for applications under Natural Security for which a startup program has already been defined. If command-name is "*", the current setting of the system variable `*STARTUP` (that is, at the time `SETUP` is issued) is used as the startup command when `RETURN` is issued.
`I` | If the `I` option is specified, all return points defined with previous `SETUP` commands will be deleted and the application specified with `SETUP I` will be defined as the new initial application. In a non-Security environment, if you log on from library `SYSTEM` to another library and no return point has been set, this other library will automatically be set as initial return point.

## SETUP/RETURN Example

1. User starts Natural session (default application is `APPL1`).

   Return point `APPL1` is defined on Level 1.

2. User issues command `LOGON APPL2`.

3. User executes a program which stacks two commands (establish return point and go to another application):

       SETUP *,MENU
       LOGON APPL3

   Return point `APPL2, STARTUP MENU` is defined on Level 2.

4. User issues command `LOGON APPL4` (user selects another application).

5. User presses a PF key which has the setting `RETURN`. Natural will issue for the user:

       LOGON APPL2
       MENU

   Return to `APPL2`, delete Level 2.

6. User executes a program which stacks:

       SETUP *,MENU
       LOGON APPL5

   Return point `APPL2, STARTUP MENU` is defined on Level 2.

7. User executes a program which stacks:

       SETUP *,MENU
       LOGON APPL6

   Return point `APPL5, STARTUP MENU` is defined on Level 3.

8. User executes a program which stacks:

       SETUP *,MENU
       LOGON APPL7

   Return point `APPL6, STARTUP MENU` is defined on Level 4.

9. User executes a program which stacks:

       SETUP *,MENU
       LOGON APPL8

   Return point `APPL7, STARTUP MENU` is defined on Level 5.

10. User executes a program which stacks:

        SETUP *,MENU
        LOGON APPL9

    Return point `APPL8, STARTUP MENU` is defined on Level 6.

11. User issues command `RETURN 2` (return two levels back).

    Natural will return user to `APPL7`, since that was the second previous session (all information for `APPL8` is now lost). Level 6 (`APPL8`) is deleted, Level 5 (`APPL7`) is activated and level deleted.

12. User issues command `RETURN`.

    Level 4 (`APPL6`) is activated, level deleted. Natural will return user to `APPL6`, since that was the session previous to `APPL7`.

13. User issues command `RETURN`.

    Level 3 (`APPL5`) is activated, level deleted. Natural will return user to `APPL5`, since that was the session previous to `APPL6`.

14. User issues command `RETURN I`.

    Level 2 (`APPL2`) is deleted, Level 1 (`APPL1`) is activated.

### On this page

- SETUP Syntax Explanation
- SETUP/RETURN Example