Page 1 of 1

COND check

PostPosted: Tue Sep 03, 2013 8:32 pm
by Farhaan4mf
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.

Re: COND check

PostPosted: Tue Sep 03, 2013 8:54 pm
by Akatsukami
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.

Re: COND check

PostPosted: Tue Sep 03, 2013 9:09 pm
by Farhaan4mf
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

Re: COND check

PostPosted: Tue Sep 03, 2013 9:39 pm
by Akatsukami
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