Using the Database Unload Command for Scheduler
search cancel

Using the Database Unload Command for Scheduler

book

Article ID: 26794

calendar_today

Updated On:

Products

Scheduler Job Management

Issue/Introduction

The UNLOAD command is used to read the existing definitions for schedules, jobs, calendars or datetables in the Scheduler database. It will produce an output, which can be routed to SYSPRINT or a dataset, that consists of DEFINE commands which gives the ability to rebuild the schedules, jobs, calendars or datetables the way they are currently defined.

 

Environment

Release:  All
Component: Scheduler Job Management MVS

Resolution

The UNLOAD command can serve many purposes in helping manage your database.

  1. Use the UNLOAD command to serve as a backup prior to making changes to jobs, schedules definitions or calendars or datetables.
  2. UNLOAD can be used to extract jobs/schedule definitions and then populate them to another copy of scheduler.
  3. Testing job flow for new schedules can be done before production implementation. Define new jobs/schedules with test names with Non-Exec=N. Run the schedule to verify execution order. Once testing is completed, UNLOAD the jobs/schedule and modify the names to production names and change to NONEXEC=Y. Load job/schedules using the CAJUTIL0 utility.

Here is the sample JCL to unload a schedule.

//STEP1   EXEC CAJUTIL0      

//UNLOADX DD DSN=<data set name>,

//            DISP=(,CATLG,DELETE),                          

//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120),          

//            SPACE=(TRK,1),UNIT=SYSDA                       

//SYSIN    DD *                                              

UNLOAD S N=<schedule name>,DDNAME=UNLOADX,INCLUDE=YES

//

INCLUDE=YES will unload jobs in the schedule, calendar and datetables exclusively used for this schedule

Here is a short sample of the output that you will receive with UNLOAD S N=<schedule name>,DDNAME=SYSPRINT,INCLUDE=YES.

DEFINE SBR NAME='schedule_name',ABORTIME='000000',ABRTPOST='NO',          

AUTOSEL='NO',AVGTIME='000000',BACKLOG='YES',CLASS='A',CONTINUE='NO', 

DATETABL='NULL',DDNAME='NULL',DEADLINE='000000',DELAYTIM='000000',   

ERLYTIME='000000',HOLD='NO',INSRRMS='NULL',INSRSENV='NULL',          

JOBTYPE='NULL',LIBTYPE='NULL',MAXTIME='000000',MUSTTIME='000000',    

NODE='NULL',NODESYS='NULL',NONEXEC='NO',PRTY='NULL',REPCOUNT='0',    

REPEAT='NO',REPENDTM='000000',REPFROM='END',REPINTVL='0000',         

SCHENV='NULL',SKIP='0',SPRTY='00',STAGE='NULL',USER01='NULL',        

USER02='NULL',USER03='NULL',USER04='NULL',USER05='NULL',USER06='NULL',

USER07='NULL',USER08='NULL',USESIM='NO'                               

*                                                                    

DEFINE SSI SCHEDULE='schedule_name',USERID='NULL',GROUPID='NULL'          

*                                                                    

DEFINE SCR NAME='schedule_name',CALENDAR='NULL',CRITERIA='                

WDAY                                                                 

*                                                                    

DEFINE JBR NAME='job_name',JNO='01',STATION='40',SCHEDULE='schedule_name',

ABEND='NULL',ABORTIME='000000',ABRTPOST='NO',AUTOSTRT='NO',          

AVGTIME='000000',BACKLOG='NULL',CLASS='NULL',DDNAME='NULL',          

DEADLINE='000000',DELAYTIM='000000',DISPKEY='NULL',DISPTIME='000000',

DRIVPARM='(NULL)',ERLYTIME='000000',FAILCODE='00000',FAILOPER='NULL',

FAILED='NULL',HOLD='NO',INSRRMS='NULL',INSRSENV='NULL',INTERUPT='NO',

JOBTYPE='NULL',JPRTY='00',LIBMEMB='NULL',LIBTYPE='TESTLIB',          

MAXTIME='000000',MBRSUBID='NULL',MEMO='NULL',MUSTTIME='000000',      

NODE='NULL',NODESYS='NULL',NONEXEC='NULL',PRTY='NULL',REPCOUNT='0',  

REPEAT='NO',REPENDTM='000000',REPFROM='END',REPINTVL='0000',         

RESTPARM='(NULL)',SCHENV='NULL',SKIP='0',STAGE='NULL',SYSID='NULL',  

TESTPARM='NULL',USESIM='NO',XPDOMAIN='NULL',XPNODE='NULL',           

XPPSWD='NULL',XPSUTYPE='NULL',XPUSER='NULL'                          

*                                                                    

DEFINE JSI JOB='job_name',JNO='01',STATION='40',SCHEDULE='schedule_name', 

USERID='NULL',GROUPID='NULL'                                         

*                                                                    

DEFINE JCR NAME='job_name',JNO='01',STATION='40',SCHEDULE='schedule_name',

CALENDAR='NULL',CRITERIA='                                            

schedule_name1 schedule_name2'                                                   

*

Note that SEPLINE=YES can be added to the UNLOAD to cause each keyword to appear in a single line.

The above example writes the output to a data set, and mass changes can be made to this file. The jobs/schedule must be deleted from the database if the names are going to be the same. Load the changed jobs/schedules using the CAJUTIL0 utility as shown below:

//STEP1 EXEC CAJUTIL0

//SYSIN DD DSN=<data set name>,DISP=SHR

The UNLOAD command provides ease and flexibility in making changes to your workload definitions.