COND check



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

COND check

Postby Farhaan4mf » Tue Sep 03, 2013 8:32 pm

Hi
STEP5 should run if RC=0 or 4 in STEP4
STEP5 should FLUSH and job should abend if RC=1 or 2 or 3 or 4 in STEP3 and > 4 in STEP4. To make it happen how should I code COND in STEP5

I had below test job
//STEP1   EXEC PGM=IDCAMS IEBGENER STEP 
//SYSPRINT DD  SYSOUT=*                 
//SYSIN    DD  *                         
 SET MAXCC = 0                           
//*                                     
//STEP2   EXEC PGM=IDCAMS, COBOL STEP   
//             COND=(0,NE)               
//SYSPRINT DD  SYSOUT=*                 
//SYSIN    DD  *                         
 SET MAXCC = 0                           
//*                                     
//STEP3   EXEC PGM=IDCAMS,   SORT STEP   
//             COND=(0,NE)               
//SYSPRINT DD  SYSOUT=*                 
//SYSIN    DD  *                         
 SET MAXCC = 0                           
//*         
  //STEP5   EXEC PGM=IDCAMS, SUBSEQUENT STEP
//             COND=((0,NE),(4,LT,STEP4))
//*                                       
//SYSPRINT DD  SYSOUT=*                   
//SYSIN    DD  *                         
 SET MAXCC = 0                           
//*                                                                 


But STEP5 is getting flush. Plz suggest.
Farhaan4mf
 
Posts: 29
Joined: Mon May 13, 2013 4:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COND check

Postby Akatsukami » Tue Sep 03, 2013 8:54 pm

Note that the job will not actually abend -- "abend" is misused by software engineers to mean "unexpected ending".

The IDCAMS step suggests that you are attempting to change the final completion code of the job. In z/OS 1.13, this is done by means of the JOBRC parameter; in previous versions, it cannot be done at all. If this is not the case, I suggest that you use an IF construct rather than the COND parameter.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: COND check

Postby Farhaan4mf » Tue Sep 03, 2013 9:09 pm

Hi Akatsukami,
In actual Scenario, there are no IDCAMS step. Instead I have a
IEBGENER in STEP1,
SORT in STEP2,
a COBOL DB2 pgm in STEP3,
a SAS proc in STEP4
and a SORT in STEP5
my target is to execute STEP5 if STEP4 give RC less than equal to 4, and RC=0 in STEP1,2,3
STEP5 should not execute if STEP4 give RC Greater than 4 or greater than 0 in STEP1,2,3
Please suggest how can I form the COND in STEP5
Farhaan4mf
 
Posts: 29
Joined: Mon May 13, 2013 4:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COND check

Postby Akatsukami » Tue Sep 03, 2013 9:39 pm

The following should serve your needs:
//IF1      IF   ((STEP1.RC=0) & (STEP2.RC=0) & (STEP3.RC=0) &         
//         (STEP4.RC<=4)) THEN
//STEP5    EXEC PGM=SORT
  :
  :
//ENDIF1   ENDIF
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post