Conditions in jcl.

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

Conditions in jcl.

Postby parasakthi » Mon Apr 05, 2010 1:04 pm


I have following condition in jcl. I want to execute the step 3150 only if the return codes of the step2400 is 04 or 08. The following code is working. But i want to change the code to NE conditions with returns code 4,8(like, 04,NE,GCP20.STEP2400....).. Can you please help me?

// COND=((00,EQ,GCP20.STEP2400),(12,EQ,GCP20.STEP2400),
// (16,EQ,GCP20.STEP2400))

Thank you,
Parasakthi N
Posts: 1
Joined: Mon Feb 02, 2009 1:38 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Conditions in jcl.


Re: Conditions in jcl.

Postby Robert Sample » Mon Apr 05, 2010 4:09 pm

From the JCL Language Reference manual:
If any of the test conditions are satisfied, the system evaluates the COND parameter as true and bypasses the job step.
So if you code COND=((04,NE,GCP20.STEP2400),(08,NE,GCP20.STEP2400)) and the return code from STEP2400 is 04 then the second test is satisfied (since 04 is not 08) and the step will be bypassed. Similarly, if the return code from STEP2400 is 08 then the first test is satisfied (since 08 is not 04) and again the step will be bypassed. And if the return code from STEP2400 is anything else, both tests will be satisfied and the step will be bypassed.

In other words, if you want to use NE for two codes on the same step, you are guaranteed to NEVER execute the step. This is not something that can be changed as it is inherent with the way the COND testing works.
Robert Sample
Global moderator
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Conditions in jcl.

Postby dick scherrer » Mon Apr 05, 2010 11:36 pm

Hello and welcome to the forum,

NOT and OR on a common "field" should be avoided everywhere. . . This causes problems with programming languages as well as problems with JCL. . .

' If fieldA not = "A" or fieldA not = "B" . . .' will be "not =" for every value that will ever pass thru the code. . .
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Return to JCL


  • Related topics
    Last post