Setting MAXCC in JCL using IDCAMS

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 
—-+—-1—-+—-2—-+—-3—-+—-4—-+—-5—-+—-6—-+—-7–
***************************** Top of Data ******************************
//R0318BMJ  JOB  (ACCNT#,&SYSUID),’SHIBU THANNIKKUNNATH’,NOTIFY=&SYSUID
//          EXEC PGM=IDCAMS                                            
//SYSPRINT  DD   SYSOUT=A                                              
//SYSIN     DD   *                                                     
   /* CHANGE THE BELOW MAXCC TO A NUMBER BETWEEN 0 AND 16*/             
   SET MAXCC=16                                                         
/*                                                                     
**************************** Bottom of Data ****************************

Screen shots

image

image

3 thoughts on “Setting MAXCC in JCL using IDCAMS”

  1. hi,
    i am trying to create a gdg but getting maxcc 16 error. i have set maxcc 16 in the jcl but still not able to resolve the issue. could you please help?

      1. //MATE17R JOB NOTIFY=&SYSUID
        //STEP1 EXEC PGM=IDCAMS
        //SYSIN DD *
        DEFINE GDG( –
        NAME(MATE17.SNEHADRI.GDG)-
        LIMIT(10) –
        NOEMPTY –
        NOSCRATCH)
        /*

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>