MainframeSupports
tip week 18/2018:

If your installation has upgraded the MVS systems to z/OS version 2.2 you can look forward to exploit a lot of functions in JCL which enables you to do stuff you previously had to use OPC/TWS or another job scheduling tool do to. My personal favourite is to start a job at a predefined time. You can do it like this:

//WEEKTIP JOB ,'WEEKTIP',NOTIFY=&SYSUID
//*
//  SCHEDULE HOLDUNTL='10:44'
//* SCHEDULE HOLDUNTL=('10:45','04/30/2018')
//*
//THESTEPS  EXEC PGM=IEFBR14
//*

For once I have to include the job card in an example. I try to avoid it as job cards varies a lot from installation to installation, even from MVS to MVS. The above job card may work, but please supply your own. The important stuff is to specify the SCHEDULE card right after the job card. Just to test how it works the example just executes a simple IEFBR14 step.

Using SCHEDULE you can control when your job will be executed. There are other parameters, but HOLDUNTL enables your job to start at a predefined time. If the above job is submitted before 10:44 it will be run at 10:44. If it is submitted after 10:44 it will not be executed until 10:44 the following day. Until the job is actually executed you can see it waiting in the input queue using SDSF/SYSVIEW. You can also get it executed sometimes in the future on a specific day by using the syntax I have specified in the JCL comment line below the SCHEDULE card. Please be aware that the date is specified as MM/DD/YYYY. I have already been fooled by that.

As a synonym for HOLDUNTL you can use STARTBY. There is a subtle difference between these two parameters which I cannot figure out, but in daily use I do not think it makes any difference which parameter you use. No matter which parameter you prefer you do no longer have to ask operations to make your simple jobs be started by OPC at a predefined time. And you do not need to remember which class was the night class. You are now in full control.

Previous tip in english        Forrige danske tip        Tip list