Transcript
Advanced Scheduling Techniques Presented by: Al Rowe
Agenda – Advanced Scheduling Techniques › Control Solutions – Who we are › Group Scheduling
› › › › › › ›
– General description – Active vs. Wait Schedule – a performance advantage – Monitoring and controlling – Group statistics Case Study No. 1 – Schedule Transition Case Study No. 2 – Hard Dates Case Study No. 3 – Almost Cyclic % Command – Invoke Submit Simulation Not Condition – CYCLIC Groups, the NOT Condition Future Scheduling (Start and Stop) – Future Scheduling Utilities – CTMBLT – Build a Schedule via batch – CTMSLC – Scheduling Clean-up
Control Solutions Control Solutions
› We Sell Products and Services – As a BMC Business Partner, we are authorized to sell: • All BMC® CONTROL-M and BMC® CONTROL-D products and associated options • BMC® MAINVIEW • BMC® Performance Management, BMC® Performance Management Express
– As a BMC Certified Service Provider, we offer the following services: • IT management evaluations • Data center performance evaluations and best practice implementations • Conversion assistance from all types of schedulers, automated restart products, tape management, console automation, and report distribution • Implementation assistance, upgrade assistance, health checks, and product training for all BMC CONTROL-M and BMC CONTROL-D products
General Description › Group Scheduling consists of two parts – The Group Entity – one • Scheduling is defined at the group level • Dependency can be at the group level – – – –
Time Resource Condition At a minimum, the group should have the same dependencies as the lead job
• An OUT condition can be at the group level
– Jobs within the group – one or many • Jobs are defined as they would be normally • Jobs refer to the “group” for their scheduling direction
Schedule Tags – One or Many
Group Entity Screen › Group Entity Screen - Differences – Group Name – This name will be propagated through all jobs – MEMNAME – Name of first real job (or a DUMMY Job) – Adjust Conditions: Y/N/D • Y = Yes, IN conditions are removed at ORDER time if the predecessor job is not scheduled • N = No, IN condition remains and becomes a manual condition • D = Dummy, the unscheduled job is loaded, but set to DUMMY • For DS a DUMMY job is always inserted for unscheduled jobs if Y is specified
– SET VAR good for every job in the group
Defining Group Scheduling › Schedule Tags –Define the scheduling information in the Group Entity –Schedule Tag Name will be referred to in the Job Definition • You may have one or many “Schedule Tags”
You may have many situations where most of the jobs run every day, but some jobs have exceptions – schedule tags are the easiest way to schedule and maintain these jobs You might even have a situation that calls for a special run for next Friday – create a special scheduling tag
Jobs Within the Group
Job that Runs on all Schedule Tags
Jobs Within the Group › Jobs within the Group are defined the same with two exceptions: – The Group name is propagated to all jobs in the group • The group name is a protected field in all jobs and cannot be changed
– In the Job parameters you refer to the TAG name(s) • Or Specify 7 indicating schedule by all TAG names
Groups on the Active Jobs File
Groups on the Active Jobs File
Group Active › Two examples are presented – Group Active – appears yellow • • • •
In example one, all the jobs have run once and it is waiting its next cycle In example two, all jobs are in a WAIT SCHEDULE status In example three, all jobs are in a WAIT SCHEDULE status The Group is in a WAIT SCHEDULE status
› Performance
– When the Group is ACTIVE, BMC CONTROL-M will scan each job in the group to determine eligibility – When the Group is WAIT SCHEDULE only the Group Entity is scanned for eligibility
Group Selection Command
G
Group Command › Group Command on a Job – Type a “G” in the option column next to a job on the AJF • BMC CONTROL-M will now display only those jobs in the Group • You can scroll up and down but will remain in the Group • PF3 to exit
– Even though you are isolated to the Group • You can type an “N” next to a job and the Network Flow will be complete – It will show jobs outside your Group
Now the Group is Isolated
N
Network Flow of Dependencies
Group Statistics
S
Group Statistics
Group Summary › List of advantages when using Groups – All scheduling is located at the Group Entity • Reduces maintenance when change is required
– %%$GRID • Makes the run of each group unique for conditions – Multiple runs of the same group in the same day without concern
• Also used for unique file names
– Group Condition – IN / OUT • A Group condition will improve performance
– Group Statistics • Total run time for the group
– Group Variables • SET VAR @ the Group Entity – can be used by all jobs
– Automatic condition setting • Removes dependencies on jobs not scheduled • Or loads the jobs not scheduled as DUMMY
Case Study No. 1 – Schedule Transition › Case Study No. 1 › You have a flow of work that has many changes – – – –
Several jobs are added Several are deleted Dependencies have changed on several jobs There is a scheduled date to start the new flow
› Save the Group under a different name
– Make all the changes – Verify the changes – Insert an “ACTIVE FROM” date MMDDYY • or YYMMDD depending on your setting in IOAPARM
› On the old schedule
– Insert an “UNTIL” date
Old Schedule ends Friday, Sept. 22, 2006
New Schedule Starts Saturday, Sept. 23, 2006
Case Study No. 2 – Hard Dates Case Study No. 2 › You have a need to schedule a job or jobs on specific dates throughout the year – Problem No. 1: You need to remember to change them for the following year – Problem No. 2: You forget, and the first run occurs on the wrong day • Updated files need to be restored • Sometimes not discovered until several days later when a user complains of incorrect data
– Problem No. 1: Still need to remember to change them – Problem No. 2: Solved
Case Study No. 2 – Hard Dates
Problem No. 2 – Solved
Case Study No. 3 – Group Loaded Multiple Times › You have many jobs that run every 10 minutes – First Idea – make them Cyclic
• Problem – jobs must be unique and re-startable • Spanning over new day could be a problem
› Before
›
– Jobs Process many transaction files throughout the day – First job copies the transaction file – Second job generates the JCL for the rest of the jobs – Jobs 3 - 15 perform various actions on the incoming transactions Problem – Jobs 3 – 15 had to complete before 1 and 2 could run again • It was all about file names
› Answer
– BMC CONTROL-M Groups and the %%$GRID • Unique for each load • Conditions and File names • Same JCL – no need for job No. 2
%%$GRID – IN / OUT Conditions
%%$GRID - Resolved
%%$GRID Used in Conditions › IN / OUT conditions using %%$GRID as the last node – Must be used as a suffix to the condition – Is resolved to the Group Order ID – Makes each group unique • Same Group can be loaded multiple times without interfering with each other • %%$GRID can also be used in DSNs to keep those unique to the run
SET VAR @ the GROUP Level
JCL as Stored in the PDS
JCL @ Submit Time
AJF – Using the % Command
% Command › The % Command will do a “SUBMIT” Simulation – Used to verify Auto-Edit resolutions – Scroll up F7, Down F8 – Command available on AJF, as well as the List of a Table screen (2)
JCL @ Submit Time
Using the Not Condition
The NOT Condition › Using the NOT Condition – great for cyclic work – Condition is Prefixed with ¬ (“not” sign) or \ – \ is easer to find on your keyboard – If the condition is not present, then the job can run • • • •
Usually dependent on itself Last job in the flow deletes the condition Since it no longer exists and the lead job is eligible May also be used in conjunction with “Interval”
CTMBLT – In Memory › Building a Schedule via a Batch Job
– Advantage – could be quicker than by hand – Use to create a permanent schedule • Tweak later for specific adjustments if necessary
› Building a Schedule in Memory
– Advantage – No multi-step operation • Build a library, order from library, cleanup after
– Build from a model – Perfect for backups and defrags • Build jobs from a volume list • Single JCL with //J%%VOL JOB Dataset //
VOL=SER=%%VOL
› Build a Schedule via REXX, CLIST, Program – Advantage – Permits dynamic situations – Build from a file of variable data – Even better in a high-volume situation
CTMBLT – Records in JCL //DAINPRM DD * LIBRARY=name1 MEM-OVERWRITE=FORCE ADD-GLOBAL=Y MEMLIB=BMCCTM.PROD.OPER.JCLLIB OWNER=PRODID GROUP=DEFRAG-BY-VOLUME DESC=‘ALL DEFRAG JOBS’ RESOURCE=(DEFRAG,0001,D,D) SHOUT-WHEN=NOTOK MSG=“%%JOBNAME J%%JOBID ENDED IN ERROR” USER=TSO-PRODID TABLE=TABLE1 MEMNAME=DFRAG SETVAR=%%VOLSER=M03372 MEMNAME=DFRAG SETVAR=%%VOLSER=M03373 MEMNAME=DFRAG SETVAR=%%VOLSER=M03374 (ETC.) //
In-Memory Global OUTTABLE DC CL16000' ' TABLE OF CARD-IMAGE CONTROL STMTS INITIAL DC CL80'LIBRARY=RDGMXV.USER.JCL' DC CL80'MEM-OVERWRITE=FORCE' DC CL80'ADD-GLOBAL=Y' DC CL80'SHOUT-WHEN=NOTOK URG=R' DC CL80'MSG='%%JOBNAME J%%JOBID ENDED IN ERROR'' DC CL80'DEST=TSO-PRODID' DC CL80'GROUP=GROUP1' DC CL80'MEMLIB=BMCCTM.PROD.OPER.JCLLIB' DC CL80'OWNER=PRODID' DC CL80'DESC='ALL DEFRAG JOBS'' DC CL80'RESOURCE=(DEFRAG,0001)' DC CL80'TABLE=TABLE1' REPEAT DC CL80'MEMNAME=DFRAG' SETVAR DC 0CL80 SPECIAL USE FOR SETVAR DC CL16‘SETVAR=%%VOLSER=' VOLSER DC CL6' ' DC CL58' '
Assembler Program Snip-it Assembler program - just an idea GETNEXT
EOF
LA R7,INSERT GET R6,EXTERNL LOAD EXTERNAL LIST OF VOLSERS MVC 0(80,R7),REPEAT LA R7,80(R7) MVC 0(16,R7),SETVAR MVC 17(6,R7),0(R6) LA R7,80(R7) CLI 0(R7),X'FF' END OF TABLE? BE ERROR YES BR GETNEXT EQU * MVC 0(80,R7),LASTCARD CALL CTMBLT,(FOUR,0,TBLADDR,ALTDDP,RPLYP) LTR R15,R15 BNZ error-routine B RETURN
... LASTCARD DC CL80'END'
DEFRAG JCL Sample //DF%%VOLSER JOB IOA,AWR,MSGCLASS=X,REGION=OK //STEP1 EXEC PGM=ADRDSSU //*---------------------------------------------------------//* VOLUME DEFRAG USING DFDSS - EXAMPLE //*---------------------------------------------------------//SYSPRINT DD SYSOUT=* //DASD DD UNIT=3390,VOL=(PRIVATE,SER=%%VOLSER),DISP=OLD //SYSIN DD * DEFRAG DDNAME(DASD) BY(LIST(REFDT LT *,-1)) /* DATE LAST REF RUNDATE -1 */ /*
CTMSLC — Schedule Library Cleanup Utility
› The CTMSLC utility enables you to remove old job scheduling definitions from the schedule library.
– A job within a regular (that is, non-group) table is considered old if the date specified in the DEFINITION ACTIVE UNTIL field of the job scheduling definition has already passed – A job within a group can be removed if one of two items is true • ACTIVE UNTIL date has passed for the Schedule Tag • ACTIVE UNTIL date has passed for the Job
Sample JCL – MODE can be either NORMAL or SIMULATION //RESTORE EXEC PGM=CTMSLC,REGION=0M //SYSIN DD * CLEANUP DSNAME=CTM.SCHED.LIB,MEMBER=TABLE1, DATE=123106,MODE=NORMAL //
Questions?