Day to day programming life we will face a lot situations where we need to set MAXCC or return code of JCL whether conditionally or unconditionally. There a are lot of possible ways to do achieve this when we execute program like (set return-code in Cobol, set RC in REXX etc..). but what we will do when we need to set MAXCC using JCL?, how to achieve this??.
One possible solution is set MAXCC using IDCAMS, since IDCAMS is available all the shops there are no pre-requisites for this. .
How to setup MAXCC of JCL using IDCAMS?
You just need to code SET MAXCC=<return code> in the SYSIN dataset of IDCAMS.
What are the limits for SET MAXCC command of IDCAMS
You can use any value as return code from 0 to 16, all the values out of this range will cause a MAXCC 16 for the JCL
Sample JCL to set MAXCC
d ===> Scroll ===> CSR