Version 4.2.6 for Mainframes
 —  Database Management System Interfaces  —

Using Natural Tools for DB2

This section covers the following topics:


Invoking Natural Tools for DB2

Start of instruction set To invoke Natural Tools for DB2

The Natural Tools for DB2 Main Menu is displayed, which offers you the following functions:

Main Menu - Functions

Application Plan Maintenance Maintain DB2 application plans online.
Catalog Maintenance Maintain the DB2 catalog.
Procedure Maintenance Insert and maintain DB2 stored procedures.
Interactive SQL Process SQL statements that are not embedded.
Retrieval of System Tables Display/print DB2 objects and user authorizations.
Environment Setting Execute SQL statements and display special register values.
Explain PLAN_TABLE Interpret your PLAN_TABLE.
File Server Statistics Display statistics on the generation and use of the file server.
DB2 Commands Execution Issue DB2 commands from Natural.

Note:
If you have created a new SYSDB2 library when installing Natural for DB2, ensure that it contains all Predict interface programs necessary to run the Natural Tools for DB2. These programs are loaded into SYSDB2 at Predict installation time (see the relevant Predict documentation).

Top of page

Editing within the Natural Tools for DB2

The free-form editor available within the Natural Tools for DB2 requires that the Software AG Editor is installed. The main and line commands available for use within the Natural Tools for DB2 are a subset of those available within this editor.

Main commands are entered in the command line of the editor screen. The most important main commands are:

Command PF Key Description
BOTTOM (++)   Positions to the bottom of the data.
CHANGE    Scans for a specified string and replaces each such string found with another specified string.
CLEAR    Clears the editor source area.
DELETE    Deletes the line(s) containing a given string according to the specified selection operands.
DOWN (+) PF 8 Scrolls the specified scroll amount downwards.
FIND    Finds a string specified by command operands at the location(s) specified by selection operands.
LEFT PF 10 Scrolls the specified scroll amount to the left.
LIMIT n    Sets a limit for the FIND command; n lines are processed.
PRINT    Prints the data displayed.
RESET    Resets all pending line commands.
RFIND PF 5 Repeats the last FIND command.
RIGHT PF 11 Scrolls the specified scroll amount to the right.
TOP (--)    Positions to the top of the data.
UP (-) PF 7 Scrolls the specified scroll amount upwards.

The scroll amount for the UP, DOWN, LEFT, and RIGHT commands is specified in the SCROLL field at the top right corner of the list screen. Valid values for the scroll amount are:

Value Explanation
CSR Scroll amount is determined by cursor position
DATA Scroll amount equals the page size less one line
HALF Scroll amount is half the page size
MAX Scroll amount equals the amount of data to the bottom/top
PAGE Scroll amount is equal to the page size
n Scroll amount is equal to n lines

Line commands are entered in the editor prefix area of the corresponding statement line. The most important line commands are:

Command Description
A Inserts line(s) to be moved or copied after the current line.
B Inserts line(s) to be moved or copied before the current line.
C Copies the current line.
CC Marks the beginning and end of a block of lines to be copied.
D Deletes the current line.
DD Marks the beginning and end of a block of lines to be deleted.
Inn Inserts nn new lines after the current line.
M Moves the current line.
MM Marks the beginning and end of a block of lines to be moved.

Both main commands and line commands are described in detail as part of the Natural Tools for DB2 online help facility, which is invoked by pressing PF1 (Help). For further details, please refer to the Software AG Editor documentation.

Top of page

Global PF-Key Settings

Within the Natural Tools for DB2, the following global PF-key settings apply:

Key Setting Description
PF1 Help Pressing PF1 invokes the Natural Tools for DB2 online help system from any screen within the Natural Tools for DB2.
PF3 Exit Pressing PF3 always takes you to the previous screen or function. When pressed on an editor screen where modifications have been made, the Exit Function window is displayed (as described in Exit Function in Program Editor and Data Area Editor in the Natural Editors documentation). When you press PF3 on the Main Menu, you leave the Natural Tools for DB2.
PF12 Canc Pressing PF12 always takes you back to the menu from where the current screen has been invoked. When you press PF12 on the Main Menu, you leave the Natural Tools for DB2.

Top of page

Global Maintenance Commands

Within the Natural Tools for DB2, the following global maintenance commands apply:

Command Description
COPY name Copies the specified member from the current library into the editor, after (A) or before (B) the current line.
LIBRARY name Specifies the Natural library "name" as current library.
LIST name* Lists all members from the current library whose names start with "name". From the list, you can select a member by marking it with "S".
PURGE name Purges the specified member from the current library.
READ name Reads the specified member from the current library into the editor. The current name is set to "name".
SAVE [name] Saves the generated code as the member "name" in the current library. If no name is specified, the current name is taken. Current library and member names are displayed above the Command line.

Member and library names must correspond to the Natural naming conventions: see Object Names (section: Editors - General Information, Getting Started) and "Naming Conventions for Libraries" in the section LOGON (Natural System Command Reference documentation). Members can be JCL members, SQL members, or output members.

Top of page