-
Notifications
You must be signed in to change notification settings - Fork 28
How do I automate the submission of a job at regular intervals?
AnatolyKolbasin edited this page Jun 8, 2021
·
1 revision
- Create the
SUBJOB
member in your PROCLIB library (for instance,SYS1.PROCLIB
)
Note: You can call it any name you like. We will need this name in the next steps.
- Write the following JCL into it:
//SUBJOB PROC CLASS='A', <- default input job class
// LIST='*', <- default SYSPRINT class
// LIB='USER01.JCLLIB', <- default JCL library name
// MEM=SMFCLEAR <- default member name
//*
//IEFPROC EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=&LIST
//SYSUT1 DD DDNAME=IEFRDER
//SYSUT2 DD SYSOUT=(&CLASS,INTRDR),DCB=BLKSIZE=80
//SYSIN DD DUMMY
//IEFRDER DD DISP=SHR,DSN=&LIB.(&MEM.)
The SUBJOB procedure will read the library name and the member name given and pass the content of that library member to the jcl internal reader. Thus, the job can be submitted for execution.
- Now let's prepare a command to submit the job from a library.
S SUBJOB,LIB=#jcl_lib,MEM=#lib_member
Note:
-
SUBJOB
is the proclib member name we specified in the first step -
#jcl_lib
is the name of the JCL library -
#lib_member
is the name of the library member where the job is placed - The parameters can be omitted if we are going to submit the job that was set by default
- Now we can use the automatic JES commands to schedule job submitting. For instance, submit a job every 20 seconds.
/$T A,I=20,'$VS,''S SUBJOB,LIB=''#jcl_lib'',MEM=#lib_member'' '
When you code this command, JES2 establishes a starting point T(hhh.mm)
(when to begin issuing a command), and an interval I(sssss)
(when to repeat a command).
Description | Command |
---|---|
Display automatic commands you are authorized to see | /$T A,ALL |
Issue $jes-command every 90 seconds |
/$T A,I=90,'$jes-command' |
Issue $d u every 24 hours from starting point 12:30 AM |
/$T A,T=00.30,I=86400,'$d u' |
Issue MVS command SEND 'message-text' every 20 seconds |
/$T A,I=20,'$VS,''SEND ''message-text''''' |
Cancel all automatic commands | /$C A,ALL |
Cancel automatic command with ID = 2 | /$C A2 |
For more information on the automatic JES commands - IBM documentation
SMP/E
- How do I check if the APAR or the PTF installation?
- JCL job to create SMP/e zones environment and user datasets
- JCL job to customize SMP/e distribution zone environment
- JCL job to customize SMP/e global zone environment
- JCL job to customize SMP/e target zone environment
- JCL job to load PTF information into global zone and SMP/e datasets
- JCL job to install PTF in the SMP/e target libraries
- JCL job to install PTF in the SMP/e distribution libraries
- JCL job for rejecting PTF to clean up the global zone
- JCL job for restoring PTF to clean up the target zone
- Automated build PTF via JCL + REXX template (IN PROGRESS)
- What should I do if RECEIVE ends with RC=12?
Mainframe automation solutions and best practices
- Mainframe DevOps tutorial – How We Bring DevOps and Automation to Mainframe
- Jenkins MF pipeline code example
- Mainframe integration with Jenkins using USS agent
- Jenkins plug in solution for running JCL jobs
- Mainframe troubleshooting platform - APPULSE
- Azure DevOps with MF (IN PROGRESS)
- Zigi
z/OS DevOps scripts
- Shell script for datasets to transfer from UNIX to the mainframe via ftp
- Shell script to run JCL jobs on the mainframe via ftp
- Shell script to transfer changed sources in git to the mainframe via ftp
RACF
REXX scripts
- REXX script to change parameters values in a config file
- REXX script to replace substring in some members of dataset
ISPF
HSM
- HSM dataset level commands
- HSM system commands
- How do I restore datasets anywhere where HSM is working?
Useful tricks
- How to include a library in the current LOGON session
- How to make IBM Java work for TEP file tep.jnlp
- How to migrate one or more data sets to migration volumes
- How to transfer file from Windows to zOS with command line ftp?
- How do I find out which data sets have used the most amount of space?
- How do I convert a hexadecimal date to a readable date on z/OS?
- How do I compare two data sets interactively?
- How do I use 3270 emulators with a larger screen size?
- How do I make some changes in each member of PDS?
- How do I copy data sets to other LPAR?
Batch jobs (JCLs)
- How to automate checking for normal completion of a job (counting the number of lines)?
- How do I create a Data Set or a Data Set member?
- How do I copy a Data Set or a Data Set member?
- How do I fill VSAM with records?
- How do I rename a Data Set in batch?
- How do I delete a Data Set or a Data Set member?
- How do I compress a Partitioned Data Set?
- How do I convert Partitioned Data Set PDS to Partitioned Data Set Extended PDSE and vice versa?
- How do I split a Sequential Data Set or PDS member?
- How do I copy first n records of Sequential Data Set or PDS member?
- How do I work with a Catalog?
- Replacing archaic JCL constructs
- Sample solution to transfer datasets from one system to another using XMIT and ADRDSSU
- JCL job template for evenly dividing the dataset into parts
- How to work with a Catalog?
z/OS System operating
- z/OS network commands
- JES commands
- SDSF commands
- XMIT
- WLM (COMING SOON, STAY TUNED)
- IPL and its maintenance
- Omegamon for Storage
- Omegamon for DB2
z/OS Subsystem operating