Table of Contents

Search

  1. Preface
  2. Part 1: Introduction
  3. Part 2: Samples and Examples
  4. Part 3: Tools and Utilities
  5. Part 4: SDK Resources

Sample Script File

Sample Script File

The
sample_job_step_script
shows the execution of the MDM Hub job steps. On failure, the job stream aborts and passes the return code to the caller.
The following script shows the bash version:
#!/bin/bash MDM_SCRIPTS_DIR="/apps/mdm_exec_batch_process/scripts" # Save user's current working directory SAVE_DIR=`pwd` # directory change to script directory cd "$MDM_SCRIPTS_DIR" RETURN_CODE=0 # Execute the step. Check return code. If not zero, restore directory # and exit passing the return code ./mdm_exec_batch_proc.sh -action stage -tablename C_STG_IMS_PROD_MSTR RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi ./mdm_exec_batch_proc.sh -action load -tablename C_STG_IMS_PROD_MSTR RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi ./mdm_exec_batch_proc.sh -action stage -tablename C_STG_CMN_PROD_MSTR RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi ./mdm_exec_batch_proc.sh -action load -tablename C_STG_CMN_PROD_MSTR RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi ./mdm_exec_batch_proc.sh -action execbatchgroup -batchgroupname "bg stg ims" - resume true RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi ./mdm_exec_batch_proc.sh -action automatchmerge -tablename C_BO_PROD_MSTR RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi # Do a final tokenize ./mdm_exec_batch_proc.sh -action tokenize -tablename C_BO_PROD_MSTR RETURN_CODE=$? if [ $RETURN_CODE != 0 ]; then cd "$SAVE_DIR" exit $RETURN_CODE fi # successful completion exit # All step executed successfully, restore user's directory, exit with return code cd "$SAVE_DIR" exit $RETURN_CODE

0 COMMENTS

We’d like to hear from you!