Page 1 of 1

Use of Conditions with Include member

PostPosted: Wed Feb 13, 2013 8:44 pm
by nikesh_rai
Hi,

I want to execute a step having Include member logic with some condition. COND option can not be used with Include Member. Is there any other way to do this.
Here is my code

000102 //STEP006  INCLUDE MEMBER=COMPILE1   
000103 //STEP007  INCLUDE MEMBER=RUNJCL1     


I want to execute step007 if step006 has been run successfully and given return code =< 4

Thanks
Nikesh

Re: Use of Conditions with Include member

PostPosted: Wed Feb 13, 2013 9:16 pm
by MrSpock
We won't be able to even make a guess until we know what RUNJCL1 looks like. It should have the COND= or IF/THEN/ELSE logic in it to meet your requirements for STEP006. Even better, if you could post the entire contents of the interpreted JCL, that would be great.

Re: Use of Conditions with Include member

PostPosted: Thu Feb 14, 2013 10:01 am
by steve-myers
You can't do it. The JCL INCLUDE statement is processed before any steps are run, so you can't do a conditional INCLUDE based on the execution results of a JCL step. Period. Full stop. End of story.

You may have a confused notion about job processing.
  1. The entire job is read by JES. JES does minimal analysis of the input. It detects and partially analyzes the JOB JCL statement. It detects and analyzes DD * and DD DATA JCL statements.
  2. The JCL is analyzed by an MVS component called the Converter. The Converter analyzes // INCLUDE statements. All JCL syntax errors are detected by the Converter. The Converter prepares a data set in the JES2 SPOOL containing data called internal text, which is just a coded version of the JCL statements. Since // INCLUDE statements contain no data required to actually execute the job, I do not think they are part of the internal text.
  3. The job is then executed using the internal text data set to build the internal control blocks used when the job is run.
  4. After the job completes execution, the JES control blocks created by SYSOUT data sets are used to queue the output for print processing. This part of JES prepares any notification messages requested by the JOB statement NOTIFY parameter.
  5. Print output is processed, as well as data sets being sent to other NJE nodes.
  6. The job is purged after all the output data sets have been processed.

Re: Use of Conditions with Include member

PostPosted: Mon Feb 18, 2013 2:51 pm
by halfteck
A possible solution would be to not use include, but an EXEC for RUNJCL1, this could contain a COND or IF/THEN/ELSE as required, looking back to all / or specific previous steps in STEP06

Re: Use of Conditions with Include member

PostPosted: Tue Feb 19, 2013 4:14 pm
by nikesh_rai
Thanks all for your help.

IF/THEN/ELSE worked as per my expectation. here is the code given below

//STEP006  INCLUDE MEMBER=COMPILE1         
// IF (RC LT 8 ) THEN                       
//STEP007  INCLUDE MEMBER=RUNJCL1           
// ENDIF