Hi Fabio,
I'm sorry, I don't quite understand what you mean.
If a job terminates, it is reported by the jobserver to the scheduling server.
The exit code is mapped to an exit state by the exit state mapping.
Then this exit state is merged into it's parent's state using the parent's exit state profile.
If you have a look at the output of a "show job", you'll find all relevant information:
[SYSTEM@localhost:2507] SDMS> show job 1511206;
Job
ID : 1511206
SE_NAME : SYSTEM.TESTS.EVENTS.BATCH_EXAMPLE.JOB4
SE_OWNER : ADMIN
SE_TYPE : JOB
SE_RUN_PROGRAM : 0
SE_RERUN_PROGRAM : <null>
SE_KILL_PROGRAM : <null>
SE_WORKDIR : <null>
SE_LOGFILE : ${JOBID}.log
SE_TRUNC_LOG : false
SE_ERRLOGFILE : ${JOBID}.log
SE_TRUNC_ERRLOG : false
SE_EXPECTED_RUNTIME : 0
SE_PRIORITY : 50
SE_SUBMIT_SUSPENDED : false
SE_MASTER_SUBMITTABLE : false
SE_DEPENDENCY_MODE : AND
SE_ESP_NAME : STANDARD
SE_ESM_NAME : <default>
SE_ENV_NAME : SERVER@LOCALHOST
SE_FP_NAME : <null>
MASTER_ID : 1511199
CHILD_TAG : <null>
SE_VERSION : 48594361
OWNER : ADMIN
...
STATE : FINAL
IS_DISABLED : false
IS_CANCELLED : false
JOB_ESD_ID : SUCCESS
JOB_ESD_PREF : 2
JOB_IS_FINAL : true
JOB_IS_RESTARTABLE : false
FINAL_ESD_ID : SUCCESS
EXIT_CODE : 0
COMMANDLINE : 0
...
Job shown
To make it easier to read, I deleted some of the output.
Anyway, you have the information exit_code, job_esd_id and final_esd_id.
The exit_code is, eh, the exit code.
The job_esd_id is the exit state of the job itself; the mapped exit code.
The final_esd_id is the merged exit code of the job and it's children.
All this information is also present in the database (of course). OK, the job_esd_id and final_esd_id are in fact ID's of exit state definitions.
I think the required join is so simple, I don't need to write it down.
HTH
Regards,
Ronald