Version 4.2.6 for Mainframes
 —  Database Management System Interfaces  —

Issuing DB2 Commands from Natural

The DB2 Command part of the Natural Tools for DB2 enables you to issue DB2 commands from a Natural environment.

A file is maintained for each user on the FUSER file. This file is stored under the object name DB2$CMD in the Natural library of the current user.

You can select a command and submit it, save the command file and save and/or print the output report.

This section covers the following topics:


Invoking the DB2 Command Part

Start of instruction set To invoke the Interactive SQL function

The Execute DB2 Command screen is displayed:

   16:07:56              ***** NATURAL TOOLS FOR DB2 *****            2006-05-24
                              - Execute DB2 Command -                            
  
  
  
  
  
                          Code   Function           
  
                            C    Display Commands   
                            O    Display Output     
                            ?    Help               
                            .    Exit               
  
                    Code .. _    Library .. DBA_____
  
  
  
  
  
  
  Command ===>
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
        Help        Exit                                                  Canc

The following functions are available:

Code Decription
C Displays your command file. If you have not saved a command file yet, a default file is displayed.
O If an output file exists, the output report is displayed.

The following parameter can be specified:

Library: You can enter a user name or library. The default is the currrent user ID.

Top of page

Displaying the Command File

Start of instruction set To display the command file

The DB2 Commands screen is displayed:

  16:12:11              ***** NATURAL TOOLS FOR DB2 *****            2006-05-24
                                 - DB2 Commands -                                
  
    Mark the line of the command you want to execute with 'S' and press PF4
  
    Cmd 1    _    -DISPLAY THREAD (*).........................................
    Cmd 2    _    -DISPLAY LOCATION...........................................
    Cmd 3    _    -DISPLAY DATABASE(*) LIMIT(2500)............................
                  ............................................................
    Cmd 4    _    -DISPLAY PROCEDURE (*)......................................
                  ............................................................
    Cmd 5    _    -DISPLAY DATABASE(DSNDB04) LIMIT (*)........................
                  ............................................................
    Cmd 6    _    ............................................................
                  ............................................................
    Cmd 7    _    ............................................................
                  ............................................................
    Cmd 8    _    ............................................................
                  ............................................................
                  ............................................................
  
  Command ===>
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
                     Exit  Subm  Save                                Next  Canc

Use PF11 to scroll to the next page.

You can modify the command file. Save your modifications with PF5.

Start of instruction set To execute a command

The results are displayed on the DB2 Commands Output screen:

  16:13:23              ***** NATURAL TOOLS FOR DB2 *****           2006-05-24
                              - DB2 Commands Output -                           
  
    Command:           -DISPLAY DATABASE(DSNDB04) LIMIT (*)
    Return Code 1:     00000000          Return Code 2:   00000000
    Length of Output:  00001AFB
  
    DSNT360I - ***********************************
    DSNT361I - *  DISPLAY DATABASE SUMMARY
               *    GLOBAL
    DSNT360I - ***********************************
    DSNT362I -     DATABASE = DSNDB04  STATUS = RW
                   DBD LENGTH = 72674
    DSNT397I -
    NAME     TYPE PART STATUS             PHYERRLO PHYERRHI CATALOG  PIECE
    -------- ---- ---- ------------------ -------- -------- -------- -----
    ADRESSE  TS        RW
    ALIASRBY TS        RW
    ALLDATA0 TS        RW
  
  
  Command ===>
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
                     Exit        Save  --    -     +     ++                Canc

To save the command file, use PF5; the output file is stored under the object name DB 2$OUT in the Natural library of the current user.

To return to the command file, use PF3.

You can submit further commands.

Top of page

Displaying the Output Report

Start of instruction set To display the last output record

The DB2 Commands Output screen is displayed:

  16:13:57              ***** NATURAL TOOLS FOR DB2 *****           2006-05-24
                              - DB2 Commands Output -                          
  
    Command:           -DISPLAY DATABASE(*) LIMIT(2500)
    Return Code 1:     00000000          Return Code 2:   00000000
    Length of Output:  00007468
  
    DSNT360I - ***********************************
    DSNT361I - *  DISPLAY DATABASE SUMMARY       *
               *    GLOBAL                       *
    DSNT360I - ***********************************
    DSNT362I -     DATABASE = DSNDB01  STATUS = RW
                   DBD LENGTH = 8000              
    DSNT397I -                                    
    NAME     TYPE PART STATUS             PHYERRLO PHYERRHI CATALOG  PIECE
    -------- ---- ---- ------------------ -------- -------- -------- -----
    DBD01    TS        RW
    SPT01    TS        RW
    SCT02    TS        RW
  
  
  Command ===>
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
                     Exit        Print --    -     +     ++                Canc

To print the output record, use PF5.

Top of page