How to submit a job from a TOD rule?
search cancel

How to submit a job from a TOD rule?

book

Article ID: 231283

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

I am planning to setup a Timerule to submit a job at 3 hours once, is there any utility to trigger a job?

Environment

Release : 13.5

Component : OPS/MVS

Resolution

You can use the OPSUBMIT function to submit a job. OPSUBMIT cannot be used directly in a TOD rule so you need to create a REXX program for this purpose.

For example, your TOD rule that will trigger every day at 03:00:00 will be:

)TOD  03:00:00,,
)PROC           
  address OSF   
    "OI SUBJOB" 
  return        

All this rule will do is to trigger a REXX program. The REXX program will do the actual submission:

A.1 =  "//TESTJOB  JOB (ACCT#),OPS,  "                
A.2 =  "//         CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1) "
A.3 =  "//TESTDD   EXEC PGM=IEFBR14 "                 
N = OPSUBMIT(A.)                                      

Each JCL line of your job must be assigned to a variable with a stem like above.

The OPSUBMIT function requires that the OPS parameter OSFGETJOBID is set to YES.