Job Definition Scripting Fields

In the job definition Source Options dialog boxes, four fields instruct how to behave before, during, and after a job runs. They are:

  • Pre-Job Script field

  • If Pre-Script Fails field

  • If Job Fails field

  • Post-Job Script field

The fields are described below.

  • Pre-Job Script field

    Tells DPX to run a script prior to an operation. On UNIX, the script may be a shell script (Bourne, csh, or Korn shell), a Perl script, or a script written in any scripting language on your system. On Windows, the script may be a batch file, a Perl file, a single system command, or anything executable from the DOS command line that runs in text mode.

    Use this option if you want DPX to perform certain operations such as shutting down a database before it performs an operation. Use the If Pre-Script Fails option to specify how you want DPX to behave if the pre-job script fails. If you use a pre-job script, it must be located in the directory SCHED/SCRIPTS in the directory in which DPX is installed on UNIX and SCHED\SCRIPTS in the directory in which is DPX installed on Windows.

Note. For Windows, the bexit command passes the exit status of batch execution to DPX. If this command is omitted, DPX receives an undefined exit status.

Sample DOS batch file using the bexit command

rem ** This is an example script for Windows **

rem Display current date and time.  
Date /T  
time /T

rem Run an executable named script_test.  
script_test

rem Return the status of the execution.  
rem This example assumes user is testing against and wants to return level 99.  
if 99 GEQ 1 (  
bexit.exe 99  
exit  
)  
bexit.exe 0 
  • If Pre-Script Fails field

    Determines how DPX behaves if the pre-job script fails.

Run Job/Run Post-Job Script

Runs both the job and the post-job script if the pre-job script fails.

Skip Job/Run Post-Job Script

Skips the job and runs the post-job script.

Skip Job/Skip Post-Job Script

Skips both the job and the post-job script.

  • If Job Fails field

    Determines whether DPX runs the post-job script if the job fails.

Run Post-Job Script

Runs the post-job script if the job fails.

Skip Post-Job Script

Skips the post-job script if the job fails.

  • Post-Job Script field

    Tells DPX to run a script after the operation. On UNIX, the script may be a shell script (Bourne, csh, or Korn shell), a Perl script, or a script written in any scripting language on your system. On Windows, the script may be a batch file, a Perl file, a single system command, or anything executable from the DOS command line that runs in text mode.

    Use this option if you want DPX to perform certain operations such as bringing up a database after it performs an operation. Use the If Job Fails option to determine whether the post-job script runs if the job fails. If you use a post-job script, it must be located in SCHED/SCRIPTS (UNIX) or SCHED\SCRIPTS (Windows) in the directory in which is installed.

Note. For Windows, the bexit command passes the exit status of batch execution to DPX. If this command is omitted, receives an undefined exit status.

Sample DOS batch file using the bexit command

rem ** This is an example script for Windows **

rem Display current date and time.  
Date /T  
time /T

rem Run an executable named script_test.  
script_test

rem Return the status of the execution.  
rem This example assumes user is testing against and wants to return level 99.  
if 99 GEQ 1 (  
bexit.exe 99  
exit  
)  
bexit.exe 0

Last updated