Running python code through Control-M Jobs.If below code exit with status 7 in python. Control-m should capture code and on do Action if status 7 then code should set As Ok and should mail through Control-m.
try:
fh = open("testfile", "r")
fh.write("This is my test file for exception handling!!")
except IOError:
print "Error: can\'t find file or read data"
exit(7)
Code is terminating with exit status 7 but in control-m not able to capture exit status. In Control-m, On do Action i added if status 7 then Job should Set As Ok and should send mail.
Can someone help me how Control-M can capture Python code exit status?