Using Commands and Menu Functions

#### Search Results

Search

# Using Commands and Menu Functions

You can perform an operation during a Natural session by using a Natural command or a menu function. When using a Natural command, you can directly perform an operation without navigating through different menus.

A Natural object of the type program can also be executed without using a Natural command as mentioned in Executing Programs.

This section describes the different categories of commands provided with Natural, how to execute a command and how to use a menu function.

#### Related Topic:

Natural Main Menu

This section covers the following topics:

- Categories of Natural Commands

- Using Natural Commands

- Using Natural Menus

## Categories of Natural Commands

This section describes the different categories of Natural commands:

- System Commands

- Terminal Commands

- Editor and Utility Commands

### System Commands

Natural system commands perform functions you need in order to create, maintain or execute a Natural object. In addition, Natural system commands are used to monitor and administer your Natural environment.

#### Related Topics in the System Commands Documentation:

- System Commands (Overview)

- System Commands Grouped by Category

- System Command Syntax

### Terminal Commands

Natural terminal commands, for example, can be used for the following:

- Arrange the screen display and layout such as the positioning of the PF-key and message line and the assignment of colors.

- Obtain debug information on the current environment.

- Interrupt a current Natural operation.

You can invoke a terminal command while an application is executing. In addition to the Natural command prompts, terminal commands can be entered in any alphanumeric input field. A terminal command starts with a control character that can be specified by setting a Natural session parameter. The default control character is the percent (%) sign.

#### Related Topics:

- Screen Design - Programming Guide

- Copying Data from a Screen - Programming Guide

- Terminal Commands Grouped by Function - Terminal Commands documentation

- Terminal Commands (Overview) - Terminal Commands documentation

- Using Session Parameters

### Editor and Utility Commands

In addition to Natural system and Natural terminal commands, each Natural editor and Natural utility provides its own commands that only apply to this very environment. These commands are described in the relevant sections of the Editors and Utilities documentation.

## Using Natural Commands

You enter a Natural system command at any command prompt. Natural command prompts are:

- The command line in the Natural Main Menu or on the screen of a Natural utility or system command (see also the following example).

- An editor command prompt such as the greater than (>) sign of the program editor
  (see also the following example).

- The NEXT prompt and the MORE prompt.

Some utilities require that a system command is preceded by a special sign such as double forward slashes (//). For details, refer to the relevant section in the Utilities documentation.

Most of the system commands can be entered in conjunction with one or more individual parameters and operands that further specify the operation to be performed. See also Example of a System Command.

You enter a Natural terminal command at any command prompt or in any alphanumeric input field.

You enter a Natural editor or utility command at the command prompt or in the command line of the editor or utility.

The input of a Natural command is not case-sensitive. After you have entered a Natural command, you press ENTER. ENTER confirms the action and executes the command or invokes an extra confirmation window where you explicitly acknowledge command execution.

This section covers the following topics:

- Command Line

- NEXT and MORE

- Example of a System Command

### Command Line

The command line is located above the PF-key lines and looks as follows:

    Command ===>

    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit                                                  Canc

### NEXT and MORE

The NEXT prompt appears if no Natural program (for example, the program that invokes the Natural Main Menu) has been started yet. The NEXT prompt indicates that Natural is awaiting your next command input.

The MORE prompt appears during the execution of a program and indicates that additional output is available. Press ENTER to display the additional output. If you enter a command in response to the MORE prompt, the program that is being executed will be terminated and the command will be executed.

The NEXT or MORE prompt is usually located in the left upper or lower corner of the screen as shown in the example below:

    NEXT                                                               LIB=TEST

### Example of a System Command

The following instructions are an example of how to execute a Natural system command in order to list a range of Natural objects.

To list a range of objects

1. At any command prompt, enter the system command `LIST` and one or more operands to limit the number of list items.

   For example:

       LIST P F*

   where `P` is the type of object (program) and `F*` the range of objects to be listed (all objects whose names start with F).

2. Press ENTER.

   The `LIST` command is executed and the list of objects found in the current library (here: SYSEXPG) is displayed on the screen as shown in the example below:

       14:50:43               ***** NATURAL LIST COMMAND *****              2018-07-31
       User SAG                 - LIST Objects in a Library -         Library SYSEXPG

       Cmd  Name       Type         S/C  SM Version  User ID    Date        Time
       ---  F*_______  P__________  *__  *  *______  *________  *__________ *________
       __   FINDX08    Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FINDX09    Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FINDX10    Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FINDX11    Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FORMAX01   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FORMAX02   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FORMAX03   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FORMAX04   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:58
       __   FORMAX05   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:59
       __   FORMAX06   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:59
       __   FORMAX07   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:59
       __   FORMAX08   Program      S/C  S  4.2.01   NAT421     2006-03-06  16:07:59
       __   FUNCAX01   Program      S/C  S  8.2.02   NAT822     2011-07-28  11:39:50
       __   FUNCAX03   Program      S/C  S  8.2.02   NAT822     2011-07-28  11:40:01
       __   FUNCBX01   Program      S/C  S  8.2.02   NAT822     2011-07-28  17:58:25
                                                                     15 Objects found

       Top of List.
       Command ===>
       Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
             Help  Print Exit  Sort        --    -     +     ++          >     Canc

See also the equivalent input when using the corresponding menu functions as described in Example of a Menu Function.

#### Related Topic:

Example of Command Syntax - System Commands documentation

## Using Natural Menus

Every Natural menu screen provides a list of functions. The way you invoke a function from a menu depends on the menu structure and the options provided.

Natural menus provide the following alternative methods that can be used to select and invoke a menu function:

- An individual input field for each function listed.

- The Code field, where you can enter the one- or two-character code that is assigned to each function.

- Function keys (PF keys) that correspond to a particular function in the menu.

  The PF-key lines (usually located at the bottom of the screen) indicate which function is assigned to which key. See also Standard PF Keys.

In addition to the functions, most of the Natural menus provide fields where you can specify further options and/or selection criteria. For example, the Development Functions menu contains the Name field in which you can enter the name of a Natural object. For explanations of these fields and their valid input values, refer to the relevant documentation or use the help function as described in the section Natural Online Help.

This section covers the following topics:

- Performing a Menu Function

- Terminating a Menu Function

- Standard PF Keys

- Example of a Menu Function

### Performing a Menu Function

This section provides instructions for performing and terminating menu functions.

Performing a Menu Function

- In the Code field, enter the one- or two-character code displayed before the function required and press ENTER.

  Or:
  Enter any character in the input field next to the menu function required and press ENTER.

  Or:
  If available, press the PF key that corresponds to the function required (see also Standard PF Keys).

  Or:
  Place the cursor in the input field next to the menu function required and press ENTER.

If additional input fields are displayed in the menu, enter the information required. If you fail to do so, you will receive either a window from which you can select a valid input value or a corresponding Natural error message.

For explanations of possible field entries, invoke the help function by entering a question mark (?) in the required field.

### Terminating a Menu Function

The following instructions describe alternative methods you can usually use to terminate a menu function with or without saving modifications made previously on another Natural screen.

To terminate a function without saving changes

- Enter a period (.) and press ENTER.

  Or:
  Press PF12.

To terminate a function and save changes

- Press PF3.

### Standard PF Keys

The following function keys (PF keys) are assigned to the following functions throughout most Natural menus:

PF Key | PF-Key Name | Explanation
--- | --- | ---
PF1 | Help | Invokes the online help function.
PF2 | Menu | Invokes the Natural Main Menu.
PF3 | Exit | Terminates a function.
PF12 | Canc | Terminates a function and cancels the changes made previously.

### Example of a Menu Function

The following instructions are an example of how to execute a Natural system command in order to list a range of Natural objects.

To list a range of objects

1. On the Development Functions screen:

   In the Code field, enter the one-letter code that corresponds to the function List Objects or Single Source.

   In the Type field, enter the one-letter code that corresponds to the type of Natural object (in the example below: `P` for program).

   In the Name field, enter the range of objects to be listed (in the example below: `F*` for all objects whose names start with F).

       15:05:18                    *****  NATURAL  *****                    2018-07-31
       User SAG                  - Development Functions -          Library SYSEXPG
                                                                       Mode Structured
                                                                  Work area empty

                   Code  Function            Code  Function

                    C    Create Object        L    List Objects or Single Source
                    E    Edit Object          O    List Source with Expanded Sources
                    X    Execute Program      N    List Extended Object Names
                    R    Rename Object        I    List Directory Information
                    D    Delete Objects       U    List Used Subroutines, etc.
                    S    Scan Objects         ?    Help
                                              .    Exit

            Code .. L    Type .. P   Name .. F*______________________________

       Command ===>

       Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
             Help  Menu  Exit                                                  Canc

2. Press ENTER.

   The `LIST` command is executed and a list of objects starting with the letter F is displayed on the screen as shown in Example of a System Command.

### On this page

- Categories of Natural Commands
- Using Natural Commands
- Using Natural Menus