control-m

Control-M on-do condition when Job ended


I want to add a step (On-Do) to delete a condition in Control-M V7 when a job ends (no matter which result: either OK, NOTOK, exception from OS, etc.). I've accomplished the same in Control-M V9 with the next syntax:

enter image description here

 <ON STMT="*" CODE="COMPSTAT EQ ANY">
       <DOCOND NAME="MY_CONDITION" ODATE="ODAT" SIGN="DEL" />
 </ON>

However, if I implement it in Ctrl-M V7, the code COMPSTAT EQ ANY is not recognized throwing the next validation error:

Control-M V7

The On/Statement value 'COMPSTAT EQ ANY' is not valid. Please correct the definitions to COMPSTAT <completion_code>.

Does anybody know how to accomplish this task?


Solution

  • The problem is the "ANY". The best way is to cover all options with 2 ons -

    On Statement   Stmt=*   Code=COMPSTAT=0
    Do OK
    
    On Statement   Stmt=*   Code=COMPSTAT!0
    Do OK