S0C7 at the first step but the job returns CC=12

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
utkarsh
Registered Member
Posts: 79
Joined: Fri Jun 21, 2013 10:32 pm
India

S0C7 at the first step but the job returns CC=12

Post by utkarsh »

Hi,

I have a cobol db2 program abending in S0C7 at the first step but the job returns CC=12 and continue to run the next step instead of stopping at first step.


Anyone faced this issue?
User avatar
zum13
Active Member
Posts: 127
Joined: Thu May 04, 2023 12:58 am

Re: S0C7 at the first step but the job returns CC=12

Post by zum13 »

Hello.

Most of the COBOL/DB2 programs that I have seen running make use of the DSN interface under TSO, i.e. they are invoked like this:

Code: Select all

//STEP1   EXEC PGM=IKJEFT01,REGION=0M
//STEPLIB   DD DISP=SHR,DSN=DSNC10.SDSNLOAD
//          DD DISP=SHR,DSN=DSNC10.SDSNLOD2
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
 DSN SYSTEM(DSN1)
     RUN PROGRAM(MYPROG) PLAN(MYPROG) LIBRARY('MYID.LOADLIB')
 END
When an abend occurs, TSO intercepts it. When TSO ends, it gives a return code 12.

To stop your subsequent steps from running, you need to use either COND= or wrap them in IF/ENDIF statements.
User avatar
myoggradio
Registered Member
Posts: 15
Joined: Tue Jul 30, 2024 8:15 pm
Germany

Re: S0C7 at the first step but the job returns CC=12

Post by myoggradio »

Man beachte auch viewtopic.php?t=1859
Es gibt drei Möglichkeiten TSO aufzurufen. Sie unterscheiden sich in der Fehlerbehandlung. 
utkarsh
Registered Member
Posts: 79
Joined: Fri Jun 21, 2013 10:32 pm
India

Re: S0C7 at the first step but the job returns CC=12

Post by utkarsh »

zum13Hello.

Most of the COBOL/DB2 programs that I have seen running make use of the DSN interface under TSO, i.e. they are invoked like this:

Code: Select all

//STEP1   EXEC PGM=IKJEFT01,REGION=0M
//STEPLIB   DD DISP=SHR,DSN=DSNC10.SDSNLOAD
//          DD DISP=SHR,DSN=DSNC10.SDSNLOD2
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
 DSN SYSTEM(DSN1)
     RUN PROGRAM(MYPROG) PLAN(MYPROG) LIBRARY('MYID.LOADLIB')
 END
When an abend occurs, TSO intercepts it. When TSO ends, it gives a return code 12.

To stop your subsequent steps from running, you need to use either COND= or wrap them in IF/ENDIF statements.
Thanks zum13.

Does that mean that all the steps of a JCL would still execute even if the any step gets an abend?

I thought, it would stop as soon as one get the abend?
utkarsh
Registered Member
Posts: 79
Joined: Fri Jun 21, 2013 10:32 pm
India

Re: S0C7 at the first step but the job returns CC=12

Post by utkarsh »

myoggradio wrote: Tue Aug 06, 2024 4:08 pm Please also note viewtopic.php?t=1859
There are three ways to call TSO. They differ in the error handling. 
Thanks myoggradio. I checked the link and still understanding that.
User avatar
myoggradio
Registered Member
Posts: 15
Joined: Tue Jul 30, 2024 8:15 pm
Germany

Re: S0C7 at the first step but the job returns CC=12

Post by myoggradio »

Also lange Rede kurzer Sinn. Benutze IKJEFT1B statt IKJEFT01, dann werden auch Abbrüche von TSO durchgereicht. :-)
User avatar
zum13
Active Member
Posts: 127
Joined: Thu May 04, 2023 12:58 am

Re: S0C7 at the first step but the job returns CC=12

Post by zum13 »

utkarsh wrote: Tue Aug 20, 2024 11:22 am Does that mean that all the steps of a JCL would still execute even if the any step gets an abend?
 
When using IKJEFT01, it's only the abend which occurs within that TSO step which gets caught and turned into a CC 12. Any other program running outside of IKJEFT01 would have their abends handled in the normal way, i.e. the job stops running at that step.
utkarsh
Registered Member
Posts: 79
Joined: Fri Jun 21, 2013 10:32 pm
India

Re: S0C7 at the first step but the job returns CC=12

Post by utkarsh »

zum13
utkarshDoes that mean that all the steps of a JCL would still execute even if the any step gets an abend?
 
When using IKJEFT01, it's only the abend which occurs within that TSO step which gets caught and turned into a CC 12. Any other program running outside of IKJEFT01 would have their abends handled in the normal way, i.e. the job stops running at that step.
 
 
Thanks. This is a great information. 
BobP
Registered Member
Posts: 55
Joined: Mon Jun 17, 2013 1:33 pm
United States of America

Re: S0C7 at the first step but the job returns CC=12

Post by BobP »

So, what should be used as a 'rule', "IKJEFT01" or 'IKJEFT1B '?

And is 'IKJEFT1B' also 'TSO in batch'?
Thanks,
User avatar
zum13
Active Member
Posts: 127
Joined: Thu May 04, 2023 12:58 am

Re: S0C7 at the first step but the job returns CC=12

Post by zum13 »

As a rule, it's not a good idea to allow a job step which has failed to go unnoticed and allow subsequent steps to run, particulary in a production job. Running the subsequent steps could potentially cause a more serious problem which is why condition code checks are essential. CC 4 is generally considered a warning and anything higher an error. With the appropriate checks in place, the scheduling software should be able to pick up and highlight any job failures to the operations staff. Whether the job itself stops as the result of an abend in a TSO batch step then becomes irrelevant and which one of IKJEFT01 or IKJEFT1B you use a matter of installation preference. In other words, check which is standard for your site.
BobP
Registered Member
Posts: 55
Joined: Mon Jun 17, 2013 1:33 pm
United States of America

Re: S0C7 at the first step but the job returns CC=12

Post by BobP »

zoom13As a rule, it's not a good idea to allow a job step which has failed to go unnoticed and allow subsequent steps to run, particulary in a production job. Running the subsequent steps could potentially cause a more serious problem which is why condition code checks are essential. CC 4 is generally considered a warning and anything higher an error. With the appropriate checks in place, the scheduling software should be able to pick up and highlight any job failures to the operations staff. Whether the job itself stops as the result of an abend in a TSO batch step then becomes irrelevant and which one of IKJEFT01 or IKJEFT1B you use a matter of installation preference. In other words, check which is standard for your site.
Thanks, I have the same understanding. We have been using IKJEFT01 mostly. 
Thanks,
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”