MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

subsequent steps not executing in a JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Feb 03, 2006 4:42 am    Post subject: subsequent steps not executing in a JCL Reply with quote

Hai All,

I have a JCL in which there are 5 steps and in the first step a pgm is being executed and the rest of the steps do some other execution.In the pgm ,if an error is encountered the error para is dislayed and 12 is moved to RETURN-CODE and calls STOP RUN.But when i submit the JCL i get CC=12 and the pgm abends.The following steps do not execute STEP0200 , STEP0300,STEP0400 and STEP0500.
CODE IN THE PGM

Code:

DISPLAY 'ENTERING ABEND-ERROR-PARA'
DISPLAY '************************************'
DISPLAY '******  999 ABEND ERROR * **********'
DISPLAY '************************************'
MOVE 12 TO RETURN-CODE.                       
STOP RUN. 


JCL

Code:

//STEP0100 EXEC PGM=ABC                 
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//STEP0200 EXEC PGM=IEBGENER           
//SYSUT1   DD DSN=SHEKAR.TEST.A,DISP=SHR
//SYSUT2   DD DSN=SHEKAR.TEST.B,DISP=SHR
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//STEP0300                             
//STEP0400                             
//STEP0500                             
//                                     


Now i have setup a similar kind of JCL in another System and i execute a different pgm with the same error handling method as moving 12 to the RETURN-CODE and calling STOP RUN.But when i submit the JCL all the other steps STEP200,STEP0300,STEP0400 and STEP0500 are executing .
CODE IN THE PGM

Code:

DISPLAY 'ENTERING ABEND-ERROR-PARA'
DISPLAY '************************************'
DISPLAY '******  999 ABEND ERROR * **********'
DISPLAY '************************************'
MOVE 12 TO RETURN-CODE.                       
STOP RUN.       


JCL

Code:

//STEP0100 EXEC PGM=XYZ                 
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//STEP0200           
//STEP0300                             
//STEP0400                             
//STEP0500                             
//     


What is the difference between the situations explained above ? My query is why did the steps did not execute as there are no CONDITION CODES described in the steps STEP0200,STEP0300,STEP0400 and STEP0500 in Situation 1 and why did the other steps execute in Situation 2.Can anybody help me out in my query ? Basically i want all the steps to execute in Situation 1 and if i have to do that i have to change the JCL in STEP0100 ? Please correct me in my understandings .
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Feb 03, 2006 6:50 am    Post subject: Reply with quote

Quote:

Now i have setup a similar kind of JCL in another System and i execute a different pgm with the same error handling method as moving 12 to the RETURN-CODE and calling STOP RUN.



The question is did your pgm get into the abend-para on the second system, as you said it is a different pgm and it might have not have execueted the abend-para.

what is the return-code from this step? look at the jes messages and you will find the return code from each step.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bablack
Beginner


Joined: 04 Dec 2002
Posts: 71
Topics: 0
Location: Little Falls, NJ

PostPosted: Fri Feb 03, 2006 4:39 pm    Post subject: Reply with quote

When a step in a job ABENDs (as opposed to just setting a condition code), all following steps are automatically bypassed UNLESS you code COND=EVEN (execute even if a prev step ABENDed) or COND=ONLY (execute only if a prev step ABENDed) on the EXEC statements.
_________________
Bruce A. Black
Senior Software Developer
Innovation Data Processing
Back to top
View user's profile Send private message Send e-mail Visit poster's website
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Fri Feb 03, 2006 4:59 pm    Post subject: Reply with quote

Also Check whether or not you coded the COND with the JOBCARD, it seems that you do not have it at the step level. This is important to know.
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Sat Feb 04, 2006 1:21 pm    Post subject: Reply with quote

Thanks Experts for the solution provided by all people.

Here is what i have in my PGM in first situation where other steps are not executing:
SITUATION 1

Code:

DISPLAY 'ENTERING ABEND-ERROR-PARA'
DISPLAY '************************************'
DISPLAY '******  999 ABEND ERROR * **********'
DISPLAY '************************************'
MOVE 12 TO RETURN-CODE.                       
STOP RUN. 


JCL COND PARAMTER IS CODED IN THE JOB STATEMENT

Code:

//JOBCARD COND=(7,LT)
//STEP0100 EXEC PGM=ABC                 
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//STEP0200 EXEC PGM=IEBGENER           
//SYSUT1   DD DSN=SHEKAR.TEST.A,DISP=SHR
//SYSUT2   DD DSN=SHEKAR.TEST.B,DISP=SHR
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//STEP0300                             
//STEP0400                             
//STEP0500                             
// 


SITUATION 2
PGM

Code:

WORKING-STORAGE SECTION.                           
01 A                            PIC 9(02)  VALUE 5.
01 B                            PIC 9(02)  VALUE 6.
01 C                            PIC 9(02)  VALUE 0.
PROCEDURE DIVISION.                               
000-MAINLINE.                                     
    COMPUTE C = A + B.                             
    DISPLAY 'SUM IS ' C.                           
    IF A NOT EQUAL B                               
       PERFORM 999-ABEND-ERROR                     
    END-IF.                                       
    GOBACK.                                       
                                                   
999-ABEND-ERROR.                                   
    DISPLAY 'ENTERING ABEND-ERROR-PARA'.           
    DISPLAY '************************************'.
    DISPLAY '******  999 ABEND ERROR * **********'.
    DISPLAY '************************************'.
    MOVE 12 TO RETURN-CODE.
    STOP RUN.       


JCL

Code:

//STEP0100 EXEC PGM=XYZ                 
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//STEP0200           
//STEP0300                             
//STEP0400                             
//STEP0500                             
// 


SPOOL

Code:

DDNAME   StepName
JESMSGLG JES2   
JESJCL   JES2   
JESYSMSG JES2   
SYSOUT   STEP0100   
SYSPRINT STEP0200   
SYSOUT   STEP0300
SYSPRINT STEP0400
SYSPRINT STEP0500 


JESYSMSG

Code:

STEP0100 - STEP WAS EXECUTED - COND CODE 0012
STEP0200 - STEP WAS EXECUTED - COND CODE 0000
STEP0300 - STEP WAS EXECUTED - COND CODE 0000
STEP0400 - STEP WAS EXECUTED - COND CODE 0000
STEP0500 - STEP WAS EXECUTED - COND CODE 0000


SYSOUT STEP0100

Code:

SUM IS 11                           
ENTERING ABEND-ERROR-PARA           
************************************
******  999 ABEND ERROR * **********
************************************


_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group