Natural For Mainframes Fundaments
Natural For Mainframes Fundaments
Natural For Mainframes Fundaments
Specifications contained herein are subject to change and these changes will be reported in subsequent release
notes or new editions.
The name Software AG and/or all Software AG product names are either trademarks or registered trademarks of
Software AG. Other company and product names mentioned herein may be trademarks of their respective
owners.
Natural for Mainframes - Fundamentals Table of Contents
Table of Contents
Natural for Mainframes - Fundamentals . . . . . . . . . . . . . . 1
Natural for Mainframes - Fundamentals . . . . . . . . . . . . . . . 1
Components of Natural . . . . . . . . . . . . . . . . . . 2
Components of Natural . . . . . . . . . . . . . . . . . . 2
Natural Compiler . . . . . . . . . . . . . . . . . . . 2
Natural Optimizer Compiler . . . . . . . . . . . . . . . . . 2
Natural Runtime . . . . . . . . . . . . . . . . . . . 2
Natural Buffer Pool . . . . . . . . . . . . . . . . . . 3
Natural System Files . . . . . . . . . . . . . . . . . . 3
Natural Parameters . . . . . . . . . . . . . . . . . . . 3
Profile Parameters . . . . . . . . . . . . . . . . . . 4
Session Parameters . . . . . . . . . . . . . . . . . . 4
Parameter Hierarchy . . . . . . . . . . . . . . . . . . 4
Natural Commands . . . . . . . . . . . . . . . . . . . 4
System Commands . . . . . . . . . . . . . . . . . . 5
Terminal Commands . . . . . . . . . . . . . . . . . . 5
Editor and Utility Commands . . . . . . . . . . . . . . . . 5
Natural Programming Language . . . . . . . . . . . . . . . . 5
Natural Statements . . . . . . . . . . . . . . . . . . 5
Natural System Functions . . . . . . . . . . . . . . . . . 6
Natural System Variables . . . . . . . . . . . . . . . . 6
Natural Editors . . . . . . . . . . . . . . . . . . . 6
Natural Utilities . . . . . . . . . . . . . . . . . . . 7
Database Interfaces . . . . . . . . . . . . . . . . . . 7
Web Interface . . . . . . . . . . . . . . . . . . . . 7
XML Toolkit . . . . . . . . . . . . . . . . . . . . 7
Invoking and Terminating Natural Sessions . . . . . . . . . . . . . . 9
Invoking and Terminating Natural Sessions . . . . . . . . . . . . . . 9
Terminating a Natural Online Session . . . . . . . . . . . . . . 9
Terminating a Natural Batch Session . . . . . . . . . . . . . . . 9
Natural Online Help . . . . . . . . . . . . . . . . . . . 10
Natural Online Help . . . . . . . . . . . . . . . . . . . 10
General Information - Natural Help Utility . . . . . . . . . . . . . 10
Invoking the Natural Help Utility Menu . . . . . . . . . . . . . 10
Directly Accessing Help Topics . . . . . . . . . . . . . . . 11
Detailed Information on Error Messages . . . . . . . . . . . . . . 12
Displaying the Long Message Text . . . . . . . . . . . . . . . 12
Information on the Last Error . . . . . . . . . . . . . . . . 13
Specific Information on Menus and Fields . . . . . . . . . . . . . 15
Executing Commands and Menu Functions . . . . . . . . . . . . . . 16
Executing Commands and Menu Functions . . . . . . . . . . . . . . 16
Using Natural Commands . . . . . . . . . . . . . . . . . 16
Command Line . . . . . . . . . . . . . . . . . . . 16
NEXT and MORE . . . . . . . . . . . . . . . . . . 17
Example of a System Command . . . . . . . . . . . . . . . 17
Using Natural Menus . . . . . . . . . . . . . . . . . . 17
Executing a Menu Function . . . . . . . . . . . . . . . . 18
Terminating a Menu Function . . . . . . . . . . . . . . . . 18
Standard PF Keys . . . . . . . . . . . . . . . . . . 18
Example of a Menu Function . . . . . . . . . . . . . . . . 19
Switching Natural Libraries . . . . . . . . . . . . . . . . . 20
Switching Natural Libraries . . . . . . . . . . . . . . . . . 20
Logging on to Libraries . . . . . . . . . . . . . . . . . . 20
This documentation describes the components that make up a Natural environment and provides cross-references
to related topics.
In addition, this documentation introduces you to the usage of Natural on mainframe computers. It describes, for
example, how to invoke and terminate a Natural session, execute Natural functions and use the online help
provided.
Invoking and Terminating Explains how to invoke and terminate a Natural session.
Natural Sessions
Natural Online Help Describes the online help information Natural provides.
Executing Commands and Explains how to execute Natural commands and menu functions.
Menu Functions
Natural Main Menu Describes the Natural Main Menu and the subordinate menus that provide
access to development functions, settings, utilities and example libraries.
Work and Print Files Provides general information on Natural work and print files.
Components of Natural
The Natural nucleus is a collection of service routines that comprise the kernel of Natural.
This section is intended to give you an overview of the main Natural components and how they interact to
provide Natural’s functionality as a development tool:
Natural Compiler
Natural Optimizer Compiler
Natural Runtime
Natural Buffer Pool
Natural System Files
Natural Parameters
Natural Commands
Natural Programming Language
Natural Editors
Natural Utilities
Database Interfaces
Web Interface
XML Toolkit
Natural Compiler
The Natural compiler creates the executable (cataloged) form of any source of Natural programming object (see
the relevant section). During the compilation process, the Natural statements in the object source are converted
into internal Natural object code.
The Natural Optimizer Compiler optimizes Natural object code (see above) by translating it into machine code.
Related Topic:
Natural Runtime
The Natural Runtime provides the environment necessary for executing cataloged Natural programming objects
(see the relevant section) and Natural applications. The Natural runtime interprets Natural object code.
Related Topic:
Related Topics:
If Predict is installed, FDIC also contains the data for the Predict dictionary system.
If the Natural Develeopment Server is installed, FDIC also contains application descriptions.
Related Topics:
Natural Parameters
Natural parameters are used to adjust the Natural environment to your needs. With a Natural parameter you can,
for example, set defaults for report creation, define the size of a report or define the size of the editor area.
Most of the characteristics of a Natural environment are predefined by Software AG. However, depending on
your individual requirements, you can override parameters that are set by default.
There are different types of parameter: profile parameters and session parameters.
Profile Parameters
Session Parameters
Parameter Hierarchy
Profile Parameters
Profile parameters are specified statically or dynamically.
Static parameters are specified in the Natural parameter module NATPARM, during the installation of Natural.
They are used as the default for each Natural session started.
Dynamic parameters are specified at the startup of a Natural session. You can predefine a set of dynamic
parameters with the Natural SYSPARM utility.
Session Parameters
Session parameters are specified within an active Natural session and/or within a Natural programming object.
The main purpose of session parameters is to control the execution of running Natural programs.
Parameter Hierarchy
There is a hierarchical structure of the levels on which Natural parameters can be set as described in the Natural
Operations for Mainframes documentation. A parameter value set on a higher level overrides the value defined
on a lower level. For example, when you specify a parameter dynamically, the new parameter value overrides the
static specification as set for the corresponding parameter in the Natural parameter module.
Related Topics:
Natural Commands
Natural commands are used to perform functions during a Natural session as described in the section Executing
Commands and Menu Functions.
The section below contains information on the different categories of Natural commands: system commands,
terminal commands, editor and utility commands.
System Commands
Terminal Commands
Editor and Utility Commands
System Commands
Natural system commands perform functions you need to create, maintain or execute Natural programming
objects. In addition, Natural system commands are used to monitor and administer your Natural environment.
Related Topics:
Terminal Commands
Natural terminal commands are used, for example, to:
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.
A terminal command starts with a control character that can be defined by a Natural session parameter. The
default control character is the percent (%) sign. 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.
Related Topics:
Natural Statements
Natural System Functions
Natural System Variables
Natural Statements
Natural statements are programming instructions used to create a Natural program source.
When the program source has been created, the source is compiled into an executable Natural object by using the
Natural system command CATALOG or STOW.
Related Topics:
Related Topics:
Related Topics:
Natural Editors
Natural provides three editors: the program editor, the data area editor, the map editor and the DDM editor:
Program Editor:
Used for creating and maintaining programs, subroutines, subprograms, helproutines, copycodes and texts.
Data Area Editor
Used for creating and maintaining global data areas, local data areas, and parameter data areas.
This editor has a columnar format that is designed for defining the data used in Natural programs or
routines.
Map Editor
Used for creating and maintaining maps (screen layouts) referenced in a program’s INPUT or WRITE
statement.
The map editor allows direct manipulation of the fields used in an input or output map; the extended field
editing feature facilitates the definition of fields; moreover, processing rules can be attached to fields in the
map.
DDM Editor
Used for editing and maintaining data definition modules (DDMs). The DDM editor is part of the Natural
SYSDDM utility (see also Natural Utilities below).
Related Topics:
Natural Utilities
Natural utilities are tools that provide a set of functions, such as maintaining error messages, debug environments
or buffer pools.
Natural utilities are usually menu-driven but also provide commands for directly executing the utility functions
available.
Related Topics:
Database Interfaces
Natural provides an interface for accessing database or file management systems, such as Adabas, SQL and
VSAM.
Related Topics:
Adabas documentation
Natural for SQL/DS documentation
Natural for VSAM documentation
Natural for DB2 documentation
Natural for DL/I documentation
Web Interface
The Natural Web Interface provides a link between a web server (HTTP server) and a Natural mainframe
environment.
The Natural system library SYSWEB which contains all Natural modules.
Natural Web Server Extensions - the part which provides the interface to the web server on the same
machine.
The necessary middleware: EntireX or Entire Broker using RPC technology.
Related Topic:
XML Toolkit
The Natural XML Toolkit is a set of tools for XML processing which provides functionality required for the
integration of XML processing into Natural.
A Natural data definition can be generated from an XML Document Type Definition (DTD), and vice versa. The
content of a Natural variable can be serialized into an XML document, and an XML document can be parsed into
a Natural variable.
The Natural system library SYSEXXT contains all modules of the XML Toolkit.
Related Topic:
The way you invoke Natural depends on your local system environment. Ask your Natural administrator for
details. If Natural Security is installed, the access to some libraries as well as the use of some functions can be
restricted.
General information on Natural components, such as Natural statements, commands, variables, editors and
utilities.
Detailed information on Natural system error messages and user-defined messages.
Specific information on Natural menus and input fields that appear in Natural utilities and editors.
General information on Natural components is contained in the Natural Help utility which is accessed with the
system command HELP.
Detailed information on Natural messages is provided by the system commands HELP and LASTMSG.
Specific information on menus and input fields is provided by individual help functions.
Related Topics:
This section describes the help topics provided and how to access them:
1. In the Command line or at a command prompt, enter the system command HELP or a question mark (?).
The Natural Help Utility Menu appears with the list of help topics provided:
------------------------------------------------------------------------------
S Natural Statements
V Natural System Variables
F Natural System Functions
C Natural System Commands
E Natural Editors
U Natural Utilities
P Natural Session Parameters
T Natural Terminal Commands
N Natural System Messages
M User-Defined Messages
. Exit
Code .. _
------------------------------------------------------------------------------
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Canc
2. In the Code field, enter the code (letter) that corresponds to the help topic desired.
A result screen appears with information on the help topic selected, or another menu is invoked with further
help topics that help narrowing down your search.
1. In the Command line or at a command prompt, enter the system command HELP followed by the name of
the Natural component about which you request information, for example:
HELP LIST
The LIST screen of the Natural Help Utility appears with information on the system command requested as
shown in the example screen below:
------------------------------------------------------------------------------
General Syntax: LIST SEQUENTIAL object-type object-name options
DIRECTORY object-name
XREF
DDM ddm-name
More ...
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Menu Exit - + Canc
If the help text extends beyond the screen, "Page 1" appears in the upper-right corner of the screen and
"More ..." appears in the bottom-right corner of the screen.
The system messages issued by Natural begin with NAT followed by a four-digit number nnnn.
For each Natural error message, there is a short text and a long text:
The short text is the one-line message which is displayed when the error occurs.
The long text is an extended explanation of the error and the action to be taken.
When Natural issues a system message, only the error number and the short text are displayed on the screen.
With the system command HELP, you can also display the long text of the message.
or
? nnnn
or
? U nnnn
With the system command LASTMSG, you can list the short text of the error message(s) that occurred last and
additional information on the error situation. The information displayed includes associated error messages that
possibly preceded the last message.
To display the long text of the error that occurred last use either method:
The Natural System Message screen of the Natural Help utility appears with the long text of the Natural
error that occurred last as shown in the example screen of Natural System Error NAT0082:
More ...
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Menu Exit Print + Canc
2. Or, place the cursor in the message line and choose PF1/Help. This alternative only applies when the
message line is displayed on a menu screen.
Note:
With the user exit USR2002P, you can customize the Current Natural Message window by modifying the
title of the window and descriptive text, such as the field names Sh (short message), Tx (long message), Ex
(explanation) and Ac (action). USR2002P is supplied in the Natural system library SYSEXT.
The LASTMSG window appears with the short text of the error message(s) that occurred last.
2. If desired, invoke the Detailed Information window with further details on the error message(s).
Place the cursor in the message line and choose ENTER:
For further details, see LASTMSG in the Natural System Command Reference documentation.
In the Command line or in the Code field, enter a question mark (?)
Or choose PF1/Help as indicated in the PF-key lines on the screen.
Place the cursor at the beginning of the field desired and enter a question mark (?).
Related Topics:
Exceptions:
For Natural editors, there are different command prompts, such as (>) in the program editor as shown in the
example screen of the Natural program editor below.
For most Natural utilities, Natural commands must be preceded by a special sign, such as double forward
slashes (//). For details, refer to the relevant utility documentation.
Natural terminal commands can be entered in the Command line, at any command prompt or in any
alphanumeric input field.
The input of a Natural command is not case-sensitive. After you have entered a command in the Command line
or at a command prompt, 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.
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
The MORE prompt appears during the execution of a program and indicates that additional output is available.
Choose 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 stopped 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
In a Command line or at the NEXT or MORE prompt, enter a Natural system command and one or more
operands if applicable.
For example:
EDIT P PROGX
(where P is the type (Program) and PROGX the name of the Natural programming object)
Choose ENTER.
The Natural program editor is invoked and the source code of PROGX is displayed in the edit work area:
To select and invoke a menu function, Natural menus provide the following alternatives:
In addition to functions, most of the Natural menus provide fields where you specify further options and/or
selection criteria. For example, the Development Functions menu contains the Name field where you enter the
name of a Natural object. For an explanation 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.
Place the cursor in the input field next to the menu function desired and choose ENTER.
Or, place the cursor in the input field next to the menu function desired and enter any character.
Or, in the Code field, enter the one-letter code displayed before the function desired.
Or, if available, from the PF-key lines, choose the PF key that corresponds to the function desired (see also
Standard PF Keys below).
Or double-click the input field next to the function desired.
Additional options:
If additional input fields are displayed on the menu, enter the information required. If you fail to do so, you
receive either a window from which you can select a valid input value, or a corresponding Natural error
message.
For an explanation of possible field entries, invoke the help function by entering a question mark (?) in the
field desired.
Choose ENTER.
A Natural result screen or menu appears.
Choose PF3.
Standard PF Keys
By default, the following functions keys (PF keys) are assigned to the following functions throughout most
Natural menus:
1. In the Code field, enter the letter that corresponds to the function Edit Object.
2. In the Type field, enter the letter that corresponds to the type of Natural object (here: P for Program).
3. In the Name field, enter the name of the Natural object (here: PROGX).
C Create Object
E Edit Object
R Rename Object
D Delete Object
X Execute Program
L List Object(s)
S List Subroutines Used
? Help
. Exit
Code .. E Type .. P
Name .. PROGX___________________________
Command ===>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Menu Exit Canc
4. Choose ENTER.
The Natural program editor is invoked and the source code of PROGX is displayed in the edit work area as
shown in Example of a Natural System Command.
The default library ID assigned by Natural is SYSTEM if the Natural parameter AUTO is set to OFF. You can
change the default library ID at session startup by setting the parameter AUTO to ON. AUTO=ON initiates an
automatic logon to the library that corresponds to your user ID. However, different rules apply, if you log on to
Natural under Natural Security as described in the Natural Security documentation.
Related Topics:
Logging on to Libraries
Logging on to Libraries
To switch Natural libraries, you usually use the Natural system command LOGON. With the LOGON command,
you can switch to another library that already contains Natural objects, or open a new (empty) library by entering
a library-ID that does not yet exist.
Note that different rules apply if you log on to Natural or log off from Natural under Natural Security as
described in the Natural Security documentation.
To switch libraries
In the top right-hand corner of the screen, in the Library field, replace the library ID displayed with another
library ID
(see the example menu in Example of a Menu Function in the section Executing Commands and Menu
Functions).
Related Topics:
The section below contains information on the functions and input options provided with the Natural Main Menu
and its subordinate menus:
You can define a default setting by switching on Menu mode. Menu mode causes the Natural Main Menu to
be invoked automatically for the next session started.
You can invoke the Natural Main Menu within a Natural session whenever desired.
At Natural startup, specify the Natural parameter MENU=ON (activate), or MENU=OFF (deactivate).
See also MENU in the Natural Parameter Reference documentation.
At a Natural command prompt (such as NEXT or MORE), enter the system command MAINMENU.
Function
_ Development Functions
_ Development Environment Settings
_ Maintenance and Transfer Utilities
_ Debugging and Monitoring Utilities
_ Example Libraries
_ Other Products
_ Help
_ Exit Natural Session
See also Executing a Menu Function in the section Executing Commands and Menu Functions.
Each function listed on the Natural Main Menu invokes a menu of the corresponding name where you can select
further functions:
Note:
The position and color of the message line and PF-key lines on the Natural Main Menu and its subordinate
menus can be changed with the user exit USR2003P (provided in the Natural system library SYSEXT).
Development Functions
The functions listed on the Development Functions menu are those you will need most frequently when you
develop an application with Natural. The functions apply to all Natural programming objects and Predict
Descriptions (if Predict is installed) that are available in the library where you are currently logged on.
The table below contains information on the fields provided on the Development Functions menu:
Field Explanation
User The ID of the Natural user who logged in the current session.
Library The Natural library currently active.
See also Executing a Menu Function in the section Executing Commands and Menu Functions.
Type The type of programming object, such as P for Program. For further details, see Object Types in
the Natural Programming Guide.
You can leave the Type field blank if you specify the name of a Natural object that already
exists.
Name The name of the programming object.
For an explanation of valid object names, see Object Names (General Information) in the
Natural Editors documentation.
Command The Command line is an input field in which you enter a Natural command.
line For example:
To edit an existing program named PROGX, in the Command line, you would enter the system
command:
EDIT PROGX
The table below contains information on the functions provided on the Development Functions menu. For most
of the menu functions, there are equivalent Natural system commands. These alternative system commands are
listed in the table and further explained in the relevant sections in the Natural System Commands documentation.
Specify the type and the name of the object to be created. You can enter a question
mark (?) in the Type field, to select an object type from a list of all types available for
this function.
Edit Object E Invokes a Natural editor and displays the source of the specified programming object
in modify mode.
Specify the name of an existing object to be edited. You can also invoke a selection
list of objects: see Specifying Object Ranges below.
You can enter a question mark (?) in the Type field, to select an object type from a list
of all types available for this function.
You can also invoke a selection list of objects as described in Specifying Object
Ranges below. On this list, you can mark one or more objects for deletion.
Other object types cannot be executed by themselves, but must be invoked from
another object.
Specify the name of the programming object to be displayed. You can also invoke a
selection list of objects: see Specifying Object Ranges below.
You can enter a question mark (?) in the Type field, to select an object type from a list
of all types available for this function.
Programming Modes
Natural Editors
Specifying Object Ranges
Programming Modes
Natural offers two programming modes: reporting mode and structured mode. Generally, it is recommended to
use structured mode exclusively, because it provides for more clearly structured applications. Therefore, all
explanations and examples in the documentation Natural for Mainframes - Tutorial and Natural Editors refer to
structured mode. Any peculiarities of reporting mode will not be taken into consideration.
In the top right-hand corner of the Development Functions menu is the Mode field, which indicates the
programming mode currently in effect: Structured or Reporting.
In the Mode field, overwrite the first position with an S to switch on structured mode, or an R to switch on
reporting mode.
Or, in the Command line or at any command prompt, enter the system command GLOBALS SM=ON to
switch on structured mode, or GLOBALS SM=OFF to switch on reporting mode. See also GLOBALS in
the Natural System Command Reference documentation.
Related Topic:
Natural Editors
Depending on the type of the programming object, Natural invokes the appropriate editor: the program editor,
the map editor or the data area editor. For details, see the relevant sections in the Natural Editors documentation.
You can list either all programming objects available in the current library, or objects with names that start with
a certain value.
AB*
Selects all objects that begin with AB, such as AB, AB1, ABC, ABEZ.
Does not select objects that start with AA1 or ACB, for example.
Note:
The List Object(s) function provides further options to specify object ranges as described for the equivalent
system command LIST.
The system command SYSPARM invokes a utility of the same name that
is described in the Natural Utilities documentation.
Technical Session Displays technical information on your Natural session, such as user ID TECH
Information and operating system.
System File Displays the current definitions of the Natural system files. SYSPROF
Information
See also: Natural System Files in Natural Components.
Product Installation Displays a list of the products installed at your site and information on SYSPROD
Information these products.
Security Profile Only available if Natural Security is installed. PROFILE
Information
Displays the security profile currently in effect for you.
Example Libraries
When you select Example Libraries from the Natural Main Menu, a list of libraries is displayed. These libraries
contain example programs for demonstration purposes and application programming interfaces (APIs) provided
by Software AG:
Library Contents
SYSEXPG Example programs shown and referred to in the Natural Programming Guide.
SYSEXRM Example programs shown and referred to in the Natural Statements documentation and the
Natural System Variables documentation.
SYSEXV Example programs that illustrate new Natural features.
SYSEXT Application programming interfaces (APIs).
See also the system command SYSEXT as described in the Natural System Command Reference
documentation.
SYSEXTP Example programs and APIs for specific functions that apply only under certain TP monitors.
Other Products
When you select Other Products from the Natural Main Menu, a list of Software AG add-on products appears.
These products are installed at your site and can be accessed from this menu.
Natural programming objects can be stored in source form or executable (cataloged) form in a Natural system
file (see the relevant section in Natural Components).
Related Topics:
You can also define print files to be used during the current Natural session.
Defining work or print files depends on the operating system and TP system installed.