---
title: "JCL – How to Execute Only Even Steps"
description: "Here's a resolution to execute only even steps in the JCL job. The resolution is explained in detail."
url: https://srinimf.com/2021/06/26/how-to-execute-jcl-even-steps/
date: 2021-06-26
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2021/06/pexels-photo-6177594.jpeg?fit=1880%2C1253&ssl=1
categories: ["JCL"]
tags: ["JCL to run only Even Steps"]
type: post
lang: en
---

# JCL – How to Execute Only Even Steps

Here’s is resolution to execute only **EVEN steps** in JCL. There are multiple steps in a JCL Job. The idea is to run only even-numbered steps and skip odd-numbered steps. It’s also an [interview question](https://srinimf.com/2016/02/05/jcl-evergreen-interview-question-on-cond-parameter/) asked recently.

## Interview question

Here are four steps in a Job, and the question is to execute only EVEN steps (2 and 4).

```
//JOBNAME  JOB ...  ...
//STEP01   STEP ..
//STEP02   STEP...
//STEP03   STEP...
//STEP04   STEP ...
```

Advertisements

## Resolution to run only even steps

Before you try to answer. Remember these points. In JCL, you control steps execution by three methods. Those are COND, IF ELSE and RESTART parameters.

**The syntax for COND**:

```
COND=([(value,operator[,stepname])…]
      [ ,{EVEN} {ONLY}])
```

### I am just giving here the top methods that control job steps

1. COND
2. IF ELSE
3. RESTART

### Notes on these

- COND parameters, you can give in both JOB and Step
- RESTART Parameters only in Job card
- IF ELSE only in STEPs

### Resolution

```
//JOBNAME  JOB ...  ...
// RESTART=STEP02
//STEP01 STEP ..
//STEP02 STEP…
//STEP03 STEP…
  COND=(0, EQ, STEP02)
//STEP04 STEP…
```

### Explanation

The RESTART at JOB card sends the control to STEP02. In STEP03, I’ve added COND=(0, EQ, STEP02). With this, it skips STEP03, as the return code from STEP02 is ‘0’. Finally, the control goes to STEP04.

Here STEP01 and STEP03 skipped and executed STEP02 and STEP04 (Even Steps).

Keep Reading

- [COND on JOB and STEPS](https://srinimf.com/2015/12/02/3-quick-tips-mastering-cond-parameter-usage-in-job-and-step/)
- [IF ELSE Control](https://srinimf.com/2015/04/01/jcl-sort-example-for-ifthen/)

Handmade Artwork

- [Mini Art Mithila Painting](https://amzn.to/3ETH9AO)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2021%2F06%2F26%2Fhow-to-execute-jcl-even-steps%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2021%2F06%2Fpexels-photo-6177594.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=JCL%20-%20How%20to%20Execute%20Only%20Even%20Steps)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2021/06/26/how-to-execute-jcl-even-steps/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2021/06/26/how-to-execute-jcl-even-steps/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2021/06/26/how-to-execute-jcl-even-steps/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2021/06/26/how-to-execute-jcl-even-steps/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20JCL%20-%20How%20to%20Execute%20Only%20Even%20Steps&body=https%3A%2F%2Fsrinimf.com%2F2021%2F06%2F26%2Fhow-to-execute-jcl-even-steps%2F&share=email)
-

### Like this:

Like Loading…
