Getting Started with Natural

#### Search Results

Search

# Getting Started with Natural

This document covers the following topics:

- Invoking Natural's Main Menu

- Libraries

- Issuing Commands

- Creating a User Library

- Development Functions Menu

- Programming Modes

## Invoking Natural's Main Menu

The main menu of Natural provides access to Natural development functions, environment settings, utilities and example libraries.

To invoke Natural's main menu

1. Start Natural according to the procedures at your site.

   Depending on the default settings in your environment, either the Natural main menu or the `NEXT` or `MORE` command prompt appears.

2. If one of the above command prompts appears, enter the following:

       MAINMENU

   The main menu appears.

       09:51:48                    *****  NATURAL  *****                    2012-07-17
       User SAG                        - Main Menu -                Library SYSTEM

                          Function

                       _  Development Functions
                       _  Development Environment Settings
                       _  Maintenance and Transfer Utilities
                       _  Debugging and Monitoring Utilities
                       _  Example Libraries
                       _  Other Products
                       _  Help
                       _  Exit Natural Session

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

To invoke Natural's main menu

- Enter the following command at the Linux system prompt:

      natural

  The main menu appears.

       2009-06-30                         NATURAL                 Library: SYSTEM
       09:22:05                   V 6.3.7 Software AG 2009        Mode   : REPORT
       User: SAG                                               Work Area : empty
      +------------------------------------------------------------------------------+
      ¦Library          Direct           Services         OS                Fin      ¦
      +------------------------------------------------------------------------------+

       Select Library

## Libraries

All Natural objects required for creating an application are stored in Natural libraries in Natural system files. There is a system file for system programs (`FNAT`) and a system file for user-written programs (`FUSER`).

Natural thus distinguishes system libraries and user libraries. The system libraries, which start with the letters "SYS", are reserved for Software AG purposes only. A user library contains all user-defined objects (for example, programs and maps) which make up an application. The name of a user library must not start with the letters "SYS".

The field Library in the top right-hand corner of the Natural main menu (and of many other screens) shows the name of the library where you are currently logged on.

## Issuing Commands

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

## Creating a User Library

You will now create a user library with the name `TUTORIAL`. This library is to contain all Natural objects that you will create in the course of this tutorial.

To create a user library

- In the command line (indicated by Command ===> in the Natural main menu), enter the following:

      LOGON TUTORIAL

  where "TUTORIAL" is the name of the library that you create.

  `LOGON` is a system command which is used for two purposes:

  - to log on to an existing library, or

  - to create a new library when a library with the specified name does not exist.

  Or:
  In the upper right-hand corner of the screen, overwrite the name of the current library with the name of the library to which you want to log on and press ENTER.

  Example:

      11:33:26                    *****  NATURAL  *****                    2012-07-17
      User SAG                        - Main Menu -                Library TUTORIAL

## Development Functions Menu

The Development Functions menu can be used to create and modify Natural objects.

To invoke the Development Functions menu

- On the Natural main menu, enter any character in the input field next to Development Functions and press ENTER.

  Or:
  Use cursor selection, that is: place the cursor in the input field next to Development Functions and press ENTER.

  The Development Functions menu appears.

      11:56:21                    *****  NATURAL  *****                    2012-07-17
      User SAG                  - Development Functions -          Library TUTORIAL
                                                                      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 .. _    Type .. _   Name .. ________________________________

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

## Programming Modes

The programming mode is indicated in the Mode field at the top right-hand corner of the Development Functions menu.

Natural provides two different programming modes:

- Structured Mode
  Structured mode is intended for the implementation of complex applications with a clear and well-defined program structure. It is recommended to use structured mode exclusively.

- Reporting Mode
  Reporting mode is only useful for the creation of adhoc reports and small programs which do not involve complex data and/or programming constructs.

Important
This tutorial requires that structured mode is active. If you try to run your program in reporting mode, `END-IF`, `END-READ` and `END-REPEAT` will cause errors.

If reporting mode is currently active, proceed as described below.

To switch from reporting mode to structured mode

- Enter the following system command in the command line and press ENTER:

      GLOBALS SM=ON

  Or:
  In the upper right-hand corner of the Development Functions menu, overwrite the first position of the Mode field (which shows "Reporting") with the following letter and press ENTER:

      S

  Example:

      12:17:20                    *****  NATURAL  *****                    2012-07-17
      User SAG                  - Development Functions -          Library TUTORIAL
                                                                      Mode Seporting
                                                                 Work area empty

You can now proceed with your first program: Hello World!

### On this page

- Invoking Natural's Main Menu
- Libraries
- Issuing Commands
- Creating a User Library
- Development Functions Menu
- Programming Modes