# How to set Delay for a step in JCL

**URL:** <https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes\
**Created:** [February 1, 2024, 4:51pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815 "2024-02-01T16:51:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kusumam\_A\_M](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/kusumam_a_m/32/31865_2.png) [@Kusumam\_A\_M](https://techcommunity.softwareag.com/u/Kusumam_A_M)\
**Post date:** [February 1, 2024, 4:51pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/1 "2024-02-01T16:51:45Z")

</div>

Is there any way to set a delay before a step of JCL, to start that step’s execution after a minute?  
This is required in two cases:

1. ADABAS Database to be fully up, as it takes few seconds for database to come up fully, if not job abends with Response code 148
2. To have a PLOG datasets consolidation job after online backup(after it switches PLOG), so that it wont abend with error "NOT ALL REQUIRED PLOG BLOCKS WERE FOUND ON THE INPUT "

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [February 1, 2024, 5:29pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/2 "2024-02-01T17:29:42Z")

</div>

Try this:

```auto
\\WAIT EXEC PGM=SLEEP,PARM='00:00:02.00' HH:MM:SS.TH

```

---

<div class="post-metadata">

**Author:** ![MICK.FITZPATRICK](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MICK.FITZPATRICK](https://techcommunity.softwareag.com/u/MICK.FITZPATRICK)\
**Post date:** [February 1, 2024, 5:54pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/3 "2024-02-01T17:54:37Z")

</div>

Adding a somewhat arbitrary pause may not be the best solution in many cases. Consider things like including automatic restart processes, if possible, in the program getting the 148 error. Alternatively, consider splitting the job into 2 jobs where an automation solution such as OPSMVS or IBM SA does not allow the 2nd job to run until it knows adabas is up.

---

<div class="post-metadata">

**Author:** ![Kusumam\_A\_M](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/kusumam_a_m/32/31865_2.png) [@Kusumam\_A\_M](https://techcommunity.softwareag.com/u/Kusumam_A_M)\
**Post date:** [February 1, 2024, 6:26pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/4 "2024-02-01T18:26:47Z")

</div>

Hi Ralph, This throwed “program not found” error.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [February 1, 2024, 6:32pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/5 "2024-02-01T18:32:40Z")

</div>

Sorry. I thought it might be a site-specific (homegrown) utility.

I found this via Web search. I’ve not tried it, but might work.

```auto
// EXEC IESWAIT,PARM='02'

```

This can wait up to 99 seconds.

---

<div class="post-metadata">

**Author:** ![wolfgang.winter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wolfgang.winter/32/17954_2.png) [@wolfgang.winter](https://techcommunity.softwareag.com/u/wolfgang.winter)\
**Post date:** [February 1, 2024, 6:49pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/6 "2024-02-01T18:49:36Z")

</div>

IESWAIT is z/VSE only, not available on z/OS.

---

<div class="post-metadata">

**Author:** ![Craig\_Soehnlin1](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@Craig\_Soehnlin1](https://techcommunity.softwareag.com/u/Craig_Soehnlin1)\
**Post date:** [February 1, 2024, 7:07pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/7 "2024-02-01T19:07:55Z")

</div>

You can write a Natural program (Name it SLEEP) to call CMROLL and pass the needed time via SYSIN or Parms.  
Craig Soehnlin

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [February 1, 2024, 7:23pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/8 "2024-02-01T19:23:57Z")

</div>

Great idea, Craig, but I would use

```auto
CALLNAT "USR2027N"

```

rather than

```auto
CALL "CMROLL"

```

---

<div class="post-metadata">

**Author:** ![anton.britz](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/anton.britz/32/29730_2.png) [@anton.britz](https://techcommunity.softwareag.com/u/anton.britz)\
**Post date:** [February 1, 2024, 7:28pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/9 "2024-02-01T19:28:05Z")

</div>

You need to add this to your REXX util library as CLMSLEEP and the example uses : SYSTEMS.ISPF.UTILS

/\* rexx \*/

wait\_a\_sec:

parse arg seconds display

if seconds = 0 | seconds = “” | seconds = " "

then seconds = 5

if display = “N” /\* do not display the message \*/

then nop

else do

call getjob

jobname = result

say "JOBNAME=“jobname " Pausing” seconds “seconds”

end

/\* sleep for x seconds \*/

call syscalls(‘ON’) /_enable USS-Calls_/

ADDRESS SYSCALL

"sleep "seconds /_sleep for xx seconds_/

call syscalls ‘OFF’

return

b) It’s used as follows :

//CLMSLEEP PROC DELAY=05

//\*

//\* pause for xx seconds

//\*

//PAUSE EXEC PGM=IKJEFT01,PARM=‘CLMSLEEP &DELAY’

//SYSPROC DD DISP=SHR,DSN=SYSTEMS.ISPF.UTILS

//SYSTSPRT DD SYSOUT=\*

//SYSTSIN DD DUMMY

//\*

// PEND

c) and in your JCL :

//PAUSE EXEC CLMSLEEP,DELAY=30

//\*

Note: What does CLM stand for ? Comes from Clemson University

---

<div class="post-metadata">

**Author:** ![Alan\_Hein](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@Alan\_Hein](https://techcommunity.softwareag.com/u/Alan_Hein)\
**Post date:** [February 1, 2024, 7:29pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/10 "2024-02-01T19:29:51Z")

</div>

I use the following JCL to delay a job.

//\*----------------------------------------------------

//\*---- STEP0001 WILL CAUSE THE JOB TO WAIT 20 SECONDS

//\*----------------------------------------------------

//STEP0001 EXEC PGM=BPXBATCH,PARM=‘sh /bin/sleep 20’

//STDOUT DD SYSOUT=\*

//STDERR DD SYSOUT=\*

//SYSOUT DD DUMMY

//STDIN DD DUMMY

---

<div class="post-metadata">

**Author:** ![grantni](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/grantni/32/32058_2.png) [@grantni](https://techcommunity.softwareag.com/u/grantni)\
**Post date:** [February 1, 2024, 7:32pm UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/11 "2024-02-01T19:32:23Z")

</div>

If the intent is to wait for an ADABAS db to be available, rather than invoking NATURAL to perform some “wait/sleep” step could you not rather code a NATURAL/ADABAS IO against a file in the db to verify availability and use TERMINATE with status codes to return conditions to JCL for jcl/job flow control?

(presumably your friendly ADA DBA can help you with a utility that checks the status of the specific database to avoid having to fire up a NATURAL session)

---

<div class="post-metadata">

**Author:** ![ozzieandre](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@ozzieandre](https://techcommunity.softwareag.com/u/ozzieandre)\
**Post date:** [February 2, 2024, 1:08am UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/12 "2024-02-02T01:08:16Z")

</div>

Interested in this position

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [July 31, 2024, 1:08am UTC](https://techcommunity.softwareag.com/t/how-to-set-delay-for-a-step-in-jcl/290815/13 "2024-07-31T01:08:57Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
