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 system file FUSER
.
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:
To invoke the Interactive SQL function
On the Natural Tools for DB2 Main Menu, enter function code D and press ENTER.
The Execute DB2 Command screen is displayed:
16:07:56 ***** NATURAL TOOLS FOR DB2 ***** 2009-10-30 - 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 | Description |
---|---|
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:
Parameter | Description |
---|---|
Library |
You can enter a user name or library. The default is the current user ID. |
To display the command file
On the Execute DB2 Command menu, enter function code C and press ENTER.
The DB2 Commands screen is displayed:
16:12:11 ***** NATURAL TOOLS FOR DB2 ***** 2009-10-30 - 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 (Next) to scroll to the next page.
You can modify the command file. Save your modifications with PF5 (Save).
To execute a command
Mark the command with an S
and press PF4
(Subm).
The results are displayed on the DB2 Commands Output screen:
16:13:23 ***** NATURAL TOOLS FOR DB2 ***** 2009-10-30 - 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
Press PF5 (Save).
The output file is stored under the object name DB2$OUT
in the Natural library of the current user.
Press PF3 (Exit) to return to the command file.
You can submit further commands.
To display the last output record
On the Execute DB2 Command menu, enter function code O and press ENTER.
The DB2 Commands Output screen is displayed:
16:13:57 ***** NATURAL TOOLS FOR DB2 ***** 2009-10-30 - 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, press PF5 (Print).