March 30, 2010

DB2 Command Line Processor from z/OS Unix System Services

In a recent post about calling some of the delivered DB2 administration stored procedures, I mentioned it would be nice if IBM provided a testing tool to call stored procedure from z/OS. Well, it turns out that you can through a DB2 Command Line Processor (DB2CLP) that runs under UNIX System Services (USS).

USS was previously known as OpenEdition MVS (which itself was more commonly known by its short names of OMVS, Open MVS and OpenEdition). Before getting into USS features, I should first tell you about accessing USS. You may think that default access to TSO on a given LPAR gives you USS access. Not necessarily. You may have to check with your security administration team to get access to USS.

Once you have DB2 command line processor configured on USS you can issue DB2 for z/OS commands.  If you've used the command line processor delivered with DB2 for LUW, you can handle the DB2 CLP for z/OS. Now, there are some steps to follow before you can start the CLP from your login environment. Read the DB2 for z/OS installation guide -- specifically, the guide's section on DB2 CLP prerequisites and configuration -- for this information.

For a complete description of CLP, along with a list of supported DB2 commands, see the DB2 for z/OS Command Reference Guide.

Using my recent example of displaying a list of restricted database and table spaces, you would issue these commands:

connect to dbt1
call sysproc.admin_command_db2('-dis db(*) sp(*) restrict limit(*)', 34,TS,null,?,?,?,?,?,?,?,?)

The CALL statement is fully documented in the DB2 for z/OS Application Programming and SQL Guide.

If you are working with DB2 under USS, please share your impressions in Comments.