I am searching for difference between different type of code in JCL
Return Code, User Completion Code, Abend Code, Reason Code.
Other than answer to this question If you can provide me any site or book where I can read in detail about these codes it will be excellent.
Joined: 14 Mar 2007 Posts: 8652 Location: Back in jolly old England
Return code - is issued by the program and can be set to any value up to an arbitary limit (4096 I think). To know the meaning of the return code you need to read the documentation of the program / product / utility that is being executed. i.e. RC16 from SORT does not mean the same thing as RC16 from IDCAMS.
Abend / User completion code - are codes that reflect the nature of the abend. System abends are documented by IBM, user completion codes are the same as above for return codes.
Reason code - May or may no be used in conjunction with abends codes. Again totally program / product / utility dependant.
Excellent summary, expat. I'd add that return codes and abend codes have nothing to do with JCL. They are set for all of the ways you can start a program, and JCL is only one of many ways you can run a program in z/OS. for example you can call a program from JCL, TSO, Rexx, assembler, COBOL, any other programming language, ISPF, Unix system services, operator commands, etc and if the program abends, you get an abend code. Return codes are sometimes handled slightly differently depending on how the program is called. Unix system services and ISPF, for example may return different values or reserve values for special meanings.