COND= Complex Conditions with Program Setting the Condition

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
lnpdavid
Member
Posts: 11
Joined: Tue Apr 28, 2009 8:48 pm
Location: Missouri USA

COND= Complex Conditions with Program Setting the Condition

Post by lnpdavid » Tue Apr 28, 2009 9:43 pm

This is a two part question. The first one deals with a different way of coding a COND= parameter. The second deals with how the system treats the condition code itself.

First Part:
I am working on a job that has > 60 steps. One of the early steps sets a condition code of 1, 2, 3, ?, 10 in order to allow subsequent steps to either execute, or not, depending upon that code. Most of the steps create reports. Therefore, most of those steps will not be executed, only those looking for a specific return code set by that early step. As you can guess, those steps have a COND= parameter that looks like the following:

COND=((4,LE),(1,EQ),(2,EQ)) - This step will execute with the code is equal to a 3, correct? This looks kind of odd to me to code it this way, but I inherited the job, I didn?t create it. Anyhow, I would have coded it COND=(3,NE). Would this give the same result?

Second Part:
The more complex coding that I am MOST concerned about is coded:

COND=((0,NE,STEP55.SORT),(6,LE),(1,EQ),(2,EQ),(3,EQ),(4,EQ)) - If it wasn?t for the first test, I would say that this step gets executed if the code is a 5, correct? The additional test at the beginning is what confuses me the most. By itself I would say that the current step gets executed if STEP55 (a SORT step) executed successfully, giving a 0 return code. I would say that the interpretation of this COND parameter was two-fold. First, STEP55 returned 0, and the early step set a return code of 5. Is this correct? If I am correct, the confusing part is why the return codes don?t get mixed up with each other. (Conceivably, every step could then have a code that could be tested.) It?s almost like there is a general return code (e.g. the early step that turned on ?5? in this example), and a step specific code (i.e. STEP55 of ?0?). What if an intermediate step returned a code of 8 (and did not cancel)? Would the general test be able to test for a 5 without referring that test back to a specific step? I would guess that I'd have to add the step informaiton.
David Earhart

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Wed Apr 29, 2009 11:38 am

First Part :

Yes, You are correct.
COND=(3,NE) will give the same result as COND=((4,LE),(1,EQ),(2,EQ))
Natarajan
Chennai

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others