Previous Topic Next topic Print topic


IMSDBU Automation

This topic describes methods for automating database management functions. You can run IMSDBU functions using IMSDBU Runlist command files or operating system command prompt. Using these batch interfaces can simplify the execution of repetitive functions. LAN servers and other products provide timed-operation or command scheduling functions. Combining these functions with IMSDBU command execution can provide unattended operation.

Some example uses are:

The command line interface executes IMSDBU functions from an operating system command file (or command prompt). Each IMSDBU command line runs one IMSDBU function. The system return code is set to the function's ending return code. A return code of 8 or above indicates that the function failed.

IMSDBU also supports its own Runlist command files. These are similar to operating system command files but allow you to process a series of commands as a group. One operating system command starts execution of the Runlist file which contains a list of functions.

The Runlist file may be easier to use when a function depends on a previous function completing successfully. When a function in a Runlist file fails, the remaining functions are canceled. With an operating system command file, ERRORLEVEL or return code checking must be used to bypass the remaining steps.

If you need to ensure a function runs, regardless of the outcome of a previous step, use operating system command files. A combination of operating system commands and Runlist files provides a great deal of flexiblility for performing IMSDBU functions.

Example

This example demonstrates loading several databases using an operating system command file and two Runlist files. It uses four databases: A, B, C, and D. Databases A and B are logically related to each other, as are databases C and D.

A Runlist file is used to load databases A and B. The Runlist file will produce one detail list file for all of its steps. The LISTOPEN(NEW) directive on the first step creates a new listing file. The LISTOPEN(MOD) directive on the subsequent steps appends to this listing. If the Load of either database fails, there is no reason to continue the process. Both of the databases must load successfully before PtrUpdate can run. All four steps must complete successfully before the databases can be used by an application.

Runlist file LOADAB.RUN

LOAD A DSN(A.LOD) LIST(LOADAB.LST) LISTOPEN(NEW)
LOAD B DSN(B.LOD) LIST(LOADAB.LST) LISTOPEN(MOD)
PTRU A LIST(LOADAB.LST) LISTOPEN(MOD)
PTRU B LIST(LOADAB.LST) LISTOPEN(MOD)

A similar process (and Runlist file) is used to load databases C and D.

Runlist file LOADCD.RUN

LOAD C DSN(C.LOD) LIST(LOADCD.LST) LISTOPEN(NEW)
LOAD D DSN(D.LOD) LIST(LOADCD.LST) LISTOPEN(MOD)
PTRU C LIST(LOADCD.LST) LISTOPEN(MOD)
PTRU D LIST(LOADCD.LST) LISTOPEN(MOD)

An operating system command file is used to execute these two Runlist files. The following command file executes the Runlist files. The ECHO directive causes display of ending messages and error messages with a return code of 4 or greater. The ECHO stoplvl of 50 indicates that no prompting should occur for any IMSDBU messages.

LOADABCD.BAT

xx IMSDBU RUN LOADAB.RUN echo(errend,4,50) nocls
xx IMSDBU RUN LOADCD.RUN echo(errend,4,50) nocls

In this example, a failure during the load of database A would cancel the load of database B but not affect the loading of databases C and D. This operating system command file could be run unattended - the activity log and the detail list files contain the results of the execution.

Previous Topic Next topic Print topic