Controlling Db2 operations by using commands

You can control most aspects of the operational environment by issuing commands. For most commands, Db2 issues output in the form of messages. Db2 also issues system messages for other situations. To operate and recover Db2 successfully, you must know how to issue commands and retrieve and interpret command output messages and system messages.

Before you begin

Begin general-use programming interface information.Before you can issue commands, you must have the required authorities and privileges. For descriptions of the authorities and privileges that are required for particular commands, see the Authorities sections in the topics for each command under Db2 commands.

For more information about specific privileges and authorities, see Privileges and authorities.

About this task

You can control most aspects of the operational environment by using the DSN command of TSO and its subcommands and Db2 commands. However, you might also any of the following types of commands to control connections from various attachment facilities, the z/OS internal resource lock manager (IRLM), and the Administrative task scheduler:
  • The TSO command DSN and its subcommands
  • Db2 commands
  • CICS® attachment facility commands
  • IMS commands
  • Administrative task scheduler commands
  • z/OS® IRLM commands
  • TSO CLISTs

For more information about the different types of commands that you can use control Db2 operations, see Command types and environments in Db2.

Within the z/OS environment, you can issue most types of commands from different interactive contexts, including the following consoles and terminals:
  • z/OS consoles
  • TSO terminals, by any of the following methods:
    • Issuing the DSN command from the TSO READY prompt
    • Entering commands in the DB2 Commands panel inDB2I
  • IMS terminals
  • Authorized CICS terminals

You might notice the similarities between the types of commands and the types of consoles and terminals. However, do not confuse the types of commands with the types of consoles and terminals. Although they are related, you can issue many of the different commands types, and receive output messages, from many of the different consoles or terminals.

The following table summarizes the capabilities to issue different type of commands and receive output messages from specific consoles and terminals.

Table 1. Operational control summary
Type of operation z/OS console TSO terminal IMS master terminal Authorized CICS terminal
Issue Db2 commands and receive replies Yes Yes1 Yes1 Yes1
Receive Db2 unsolicited output Yes No No No
Issue IMS commands Yes2 No Yes No
Receive IMS attachment facility unsolicited output No3 No Yes No
Issue CICS commands Yes4 No No Yes
Receive CICS attachment facility unsolicited output No3 No No Yes5
Notes:
  1. Does not apply to START DB2. Commands that are issued from IMS must have the prefix /SSR. Commands that are issued from CICS must have the prefix DSNC.
  2. This applies when using outstanding WTOR.
  3. The Attachment facility unsolicited output does not include Db2 unsolicited output.
  4. Use the z/OS command MODIFY jobname CICS command. The z/OS console must already be defined as a CICS terminal.
  5. Specify the output destination for the unsolicited output of the CICS attachment facility in the RDO.
You can issue many commands from the background within batch programs, such as the following types of programs:
  • z/OS application programs
  • Authorized CICS programs
  • IMS programs
  • APF-authorized programs, such as a terminal monitor program (TMP)
  • IFI application programs
End general-use programming interface information.