How to set Delay for a step in JCL

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 "

Try this:

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

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.

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

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.

// EXEC IESWAIT,PARM='02'

This can wait up to 99 seconds.

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

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

Great idea, Craig, but I would use

CALLNAT "USR2027N"

rather than

CALL "CMROLL"
1 Like

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

1 Like

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

1 Like

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)

1 Like

Interested in this position

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