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: 103
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: 11
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: 11
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: 103
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. 
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.”