Using Natural Tools for Db2

This section describes how to invoke Natural Tools for Db2 and maintain Db2-specific objects and SQL statements. In addition, this section provides information on global PF-key settings and global maintenance commands within Natural Tools for Db2.

Notes:

  1. See also Special Requirements for Natural Tools for Db2 in Installing Natural for Db2 on z/OS.
  2. 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).

The following topics are covered:


Invoking Natural Tools for Db2

Start of instruction set To invoke Natural Tools for Db2

  • Enter the Natural system command SYSDB2

The Natural Tools for Db2 Main Menu is displayed, which offers you the functions listed below.

15:04:05              ***** NATURAL TOOLS FOR DB2 *****             2009-11-27
                                 - Main Menu -


                       Code Function

                        A   Application Plan Maintenance
                        C   Catalog Maintenance
                        I   Interactive SQL
                        R   Retrieval of System Tables
                        S   Environment Setting
                        X   Explain PLAN_TABLE
                        F   File Server Statistics
                        D   DB2 Commands Execution
                        ?   Help
                        .   Exit

                Code .. _


Command ===>

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

Main Menu Functions

Function Description
Application Plan Maintenance Maintain Db2 application plans online.
Catalog Maintenance Maintain the Db2 catalog.
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.

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.

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.

Overview of Editor Main Commands

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 (+) PF8 Scrolls the specified scroll amount downwards.
FIND   Finds a string specified by command operands at the location(s) specified by selection operands.
LEFT PF10 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 PF5 Repeats the last FIND command.
RIGHT PF11 Scrolls the specified scroll amount to the right.
TOP (--)   Positions to the top of the data.
UP (-) PF7 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

Overview of Editor Line Commands

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.

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 the sections 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.

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 Naming Conventions and Library Naming Conventions in Using Natural. Members can be JCL members, SQL members, or output members.