AnsweredAssumed Answered

If endif statement

Question asked by JeffMuller608908 on Sep 12, 2018
Latest reply on Sep 12, 2018 by JeffMuller608908

!This include statement will be added to the post process tab of all nightly unix
!batch jobs. It pulls the "TIME" and if the time is between 18:00 hours and
!24:00 hours or between 00:00 and 0600 hours it will send an email for any
!critical unix jobs that have failed. Some unix jobs run during day batch and
!we do not want an email sent to as we are monitoring the day batch.

 

:SET &TIME# = SYS_TIME()
:PRINT "Time &TIME#"

:SWITCH "Y"
: CASE &TIME# between 180000 and 240000
: CASE &TIME# between 000001 and 060000
: SET &CODERETURN# = GET_STATISTIC_DETAIL(,RETURN_CODE)
: PRINT &CODERETURN#
: IF &CODERETURN# <> "0"
: SET &ACTOBJ = ACTIVATE_UC_OBJECT(JOBS,SMART_EMAIL_JOBNAME.CRITICAL_JOBS)
: ENDIF
:ENDSWITCH

 

I have some jobs that don't start because of missing variables or whatever the case may be.  These jobs I don't believe have an error code so they are not caught by the script above.  When they don't start they get an "FAULT_OTHER - Start impossible. Other error."  I need to capture this in the script.  Does the below look correct, I have just added the BOLD.

 

:SET &TIME# = SYS_TIME()
:PRINT "Time &TIME#"

:SWITCH "Y"
: CASE &TIME# between 180000 and 240000
: CASE &TIME# between 000001 and 060000
: SET &CODERETURN# = GET_STATISTIC_DETAIL(,RETURN_CODE)
: PRINT &CODERETURN#
: IF &CODERETURN# <> "0" 
: SET &ACTOBJ = ACTIVATE_UC_OBJECT(JOBS,SMART_EMAIL_JOBNAME.CRITICAL_JOBS)
: ENDIF
:ENDSWITCH

: SET &CODERETURN2# = GET_STATISTIC_DETAIL(,STATUS)
: PRINT &CODERETURN2#
: IF &CODERETURN2# = "FAULT_OTHER" 
: SET &ACTOBJ = ACTIVATE_UC_OBJECT(JOBS,SMART_EMAIL_JOBNAME.CRITICAL_JOBS)
: ENDIF
:ENDSWITCH

Outcomes