Home|Tandem|MyTandemResources|NetBatchTutorial
********************************************************************************************
SchedulingJobsforDummies!
(UsingNetBatch)
********************************************************************************************
Contents:
IntroductiontoNetBatch
StartingtheScheduler
Communicatingwiththescheduler
Initializingthescheduler
SubmittingandRunningJobs
JobControlcommand
Windingup
IntroductiontoNetBatch:
=========================
NetBatchisabatchjobschedulingprogramthatallowsyoutoschedule(andrun!)batchjobs.
NonStopserversare(famousforand)usedforOLTPapplicationsbuteveninOLTPenvironmentyou
willhavecertainjobsthatyouneedtodoinbatch,likeprintingannual/monthlyreports,
generatingsystemperformancestatistics,etc.
StartingtheScheduler:
=======================
IssuethefollowingcommandonTACLprompttostartthescheduler.
TACL>NETBATCH/NAME$NBS,NOWAIT,CPU0/SUBVOL!
SUBVOListhesubvolumeonyoursystemwhereyouwantNetBatchtostoreitslogfiles,andabang
(!)
aftersubvolumenameinstructstheschedulertocoldstart(purgeandrecreateallitsfiles).
Thereisnothingspecialaboutthename$NBSyoucangiveanynameyouwishtorunyour
schedulerwith.
Communicatingwiththescheduler:
=================================
BATCHCOMistheutilityusedforcommunicatingwiththeNetBatchscheduler.
TACL>BATCHCOM$NBS
ThiswilldisplaytheBatchcombannerandtheBatchcompromptwhichisaclosingcurlybracket
'}'
Initializingthescheduler:
===========================
YoucanhaveanobeyfilecontainingthecommandsandyoucanobeythefileatBatchcomprompt
like
1>[Link]
Again,[Link]'sname.
Or,[Link]
ADDSCHEDULER
STARTSCHEDULER
ADDCLASSDEFAULT
ADDEXECUTORE1,CPU0
ADDEXECUTORE2,CPU1
STARTEXECUTOR*
Thismakesyourschedulerreadytoacceptjobsthatyouwanttorun.
ACLASSinNetBatchisacollectionofrelated/[Link]
belongtoaCLASS.
Hence,[Link]'t,thejobwillbe
addedtothe
classDEFAULThenceitismandatorytohavethatclassaddedtothescheduler.
AnExecutorisalogicalpipeline(oraqueue)[Link]
EXECUTORs,whereas
[Link]
controlthe
CPUonwhichtheNetBatchjobs(belongingtothatclass)[Link]'tlinkaCLASStoan
EXECUTOR,
thejobsintheCLASSwillrunonanyavailableEXECUTOR.
SubmittingandRunningjobs:
============================
YoucansubmitjobstotheschedulerbyusingtheSUBMITJOBorSUBMITJOBcommandat
[Link].
Wewillseesomesampleones.
ADDJOB1,EPDELAY,SM"10SECONDS"
ThisjobisnamedJOB1anditisidenticaltoissuingthecommand
DELAY10SECONDS
[Link],theprogram
[Link],NetBatchisascheduler,itdecides
whentorunwhichjobsandmanagesresourcesassociated,itdoesnot'run'[Link]
[Link],TACListhe
ExecutorProgram.
SMstandsforstartupmessage,themessagethatisrequiredbytheEPtodothe
desiredjob.Herethedesiredjobisonlytoissueadelayof10seconds.
Here,thejobexecutesimmediatelyuponissuingtheabovecommand.
Note:EP(executorprogram)isTACLbydefault.
ADDJOB2,EPDELAY,SM"2SECONDS",EVERY5MINUTES,AFTER13:00
[Link]
[Link],ifyouwish,alsogiveEVERY10HOURS(orEVERY10DAYS
forthatmatter).
NobodysaidyoucanuseonlyDELAYastheEP.YoucanuseANY100or700codefileas
anEPforajobdependinguponthejobrequirements.
ADDJOB3,EPFUP,SM"INFO*",OUT$[Link]
TheabovejobusesFUPastheexecutorprogramandisidenticaltoissuingcommandFUPINFO*
[Link]([Link]*command)goestoadisk
file.
Note:BydefaulttheoutputofallthejobsscheduledbyNetBatchgoestothespoolerlocation
$S.#BATCH
Ifyouhaveajobthatusesmultipleexecutorprogramsyoucanuseanobeyfileand
useTACLastheexecutorprogram(EP).
ADDJOB4,IN$[Link],AT16:00
AndthecontentsofINFILEcanbeanythingthatcanbeobeyedatTACL.
SampleINFILE:
DELAY2SECONDS
FILEINFO
#PUSHVAR
#SETVAR"THISISANINFILE"
#OUTPUTVVAR
WHO
TIME
FUPINFO*
VOLUME
TheATattributeofthisjobspecifiesthatthejobistobeexecutedEXACTLYatthattime.
(youmaynotalwaysbeabletosettheATattributeofajob,duetorestrictionsplacedonthe
scheduler
[Link],theRUNNOWcommandmaytooberestricted)
JobControlCommands:
=====================
Youcanseethestatusofyoursubmittedjobsusing
STATUS<JOBNAME>or
STATUS*(forstatusofalljobs)
commandontheBatchcomprompt.
Itistobenotedherethatajob,ifnotarecursivejob([Link]),
getsdeletedafterfirst(andonly)execution.
Youcandeleteajobusing
DELETE<JOBNAME>or
DELETEJOB*(fordeletingalljobs)
commandontheBATCHCOMprompt.
YoucanputtheexecutionofajobinHOLDstateusing
ALTER<JOBNAME>,HOLDON
AjobinHOLDstatewillnotstartexecutionunlessitsHOLDattributeisremovedby
ALTER<JOBNAME>,HOLDOFF
WindingUp:
===========
AfteryouaredonewiththeNetBatchschedulingandafteralljobsscheduledbyNetBatchhave
completed
executionandyounolongerneedthescheduleryoucanusethefollowingBatchcomcommands
SHUTDOWN
EXIT
ThefirstcommandshutsdowntheschedulerandthesecondcommandendstheBatchcomsession.
Formoreadvancedtopics,refertotheNetBatchManualsinNTL/TIM.
Privacy