Use of Conditions with Include member



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

Use of Conditions with Include member

Postby nikesh_rai » Wed Feb 13, 2013 8:44 pm

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
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Use of Conditions with Include member

Postby MrSpock » Wed Feb 13, 2013 9:16 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Use of Conditions with Include member

Postby steve-myers » Thu Feb 14, 2013 10:01 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Use of Conditions with Include member

Postby halfteck » Mon Feb 18, 2013 2:51 pm

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
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Use of Conditions with Include member

Postby nikesh_rai » Tue Feb 19, 2013 4:14 pm

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
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post