SYSABEND
SYSABEND
When a program or job step terminates abnormally, the system writes a dump of the program storage to a dataset known as a system dump dataset. SYSABEND DD statement used to specify the system dump dataset in the JCL.
If the JOB is completed successfully, the system will not generate any dump even though SYSABEND DD is coded. SYSABEND produces the dump for the system, user areas, and the input-output control blocks for the failed task.
The system dump dataset is helpful in analyzing the cause of the abnormal termination and for debugging the program or job step.
Syntax1 - Writing dump into a dataset.
//SYSABEND DD DSN=dataset-name,..
Syntax2 - Writing dump to spool.
//SYSABEND DD SYSOUT=*
Note! Coding multiple datasets is not allowed with the SYSABEND DD statement.
Examples -
Scenario - Writing dump to spool.
//TESTJOB JOB ...
//STEP1 EXEC PGM=PROG1
//SYSABEND DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
...