Sunteți pe pagina 1din 4

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>OBEYSUBVOL.NBOBEY

Again,SUBVOL.NBOBEYisonlyarepresentativenameyoucanhaveanyexistingobeyfile'sname.

Or,youcanmanuallyenterallcommandsoneatatimeattheBatchcomprompt.Thecommandsare

ADDSCHEDULER

STARTSCHEDULER
ADDCLASSDEFAULT
ADDEXECUTORE1,CPU0
ADDEXECUTORE2,CPU1
STARTEXECUTOR*
Thismakesyourschedulerreadytoacceptjobsthatyouwanttorun.

ACLASSinNetBatchisacollectionofrelated/unrelatedjobs.AlljobsinNetBatchneedto
belongtoaCLASS.
Hence,youcanmentionaclasstothetimeofsubmittingajob.Ifyoudon't,thejobwillbe
addedtothe
classDEFAULThenceitismandatorytohavethatclassaddedtothescheduler.

AnExecutorisalogicalpipeline(oraqueue)toaCPU.ACPUmaybelinkedtomultiple
EXECUTORs,whereas
anEXECUTORislinkedtoonlyoneCPU.ACLASScanbelinkedtoanEXECUTOR.Thiswayyoucan
controlthe
CPUonwhichtheNetBatchjobs(belongingtothatclass)run.Ifyoudon'tlinkaCLASStoan
EXECUTOR,
thejobsintheCLASSwillrunonanyavailableEXECUTOR.

SubmittingandRunningjobs:
============================
YoucansubmitjobstotheschedulerbyusingtheSUBMITJOBorSUBMITJOBcommandat
Batchcomprompt.Commandsforsubmittingjobscanbeaslongandcomplexasyoudesire.
Wewillseesomesampleones.

ADDJOB1,EPDELAY,SM"10SECONDS"

ThisjobisnamedJOB1anditisidenticaltoissuingthecommand

DELAY10SECONDS

attheTACLprompt.EPstandsforExecutorProgram,theprogram
thatisgoingtoexecuteyourjobs.Remember,NetBatchisascheduler,itdecides
whentorunwhichjobsandmanagesresourcesassociated,itdoesnot'run'jobs.Alljobs
shouldhaveanexecutorprogram.Unlessspecificallymentionedwhileaddingthejob,TACListhe
ExecutorProgram.

SMstandsforstartupmessage,themessagethatisrequiredbytheEPtodothe
desiredjob.Herethedesiredjobisonlytoissueadelayof10seconds.

Here,thejobexecutesimmediatelyuponissuingtheabovecommand.

Note:EP(executorprogram)isTACLbydefault.

ADDJOB2,EPDELAY,SM"2SECONDS",EVERY5MINUTES,AFTER13:00

Herethejobismadetorunevery5minutesafter1pm.Thejobwillnotrunimmediately
uponsubmission.Youcan,ifyouwish,alsogiveEVERY10HOURS(orEVERY10DAYS
forthatmatter).

NobodysaidyoucanuseonlyDELAYastheEP.YoucanuseANY100or700codefileas
anEPforajobdependinguponthejobrequirements.

ADDJOB3,EPFUP,SM"INFO*",OUT$DATA09.SUBVOL.FUPOUT

TheabovejobusesFUPastheexecutorprogramandisidenticaltoissuingcommandFUPINFO*
ontheTACLprompt.Theoutputofthisjob(i.e.theoutputofFUPINFO*command)goestoadisk
file.

Note:BydefaulttheoutputofallthejobsscheduledbyNetBatchgoestothespoolerlocation
$S.#BATCH

Ifyouhaveajobthatusesmultipleexecutorprogramsyoucanuseanobeyfileand
useTACLastheexecutorprogram(EP).

ADDJOB4,IN$DATA09.SUBVOL.INFILE,AT16:00


AndthecontentsofINFILEcanbeanythingthatcanbeobeyedatTACL.

SampleINFILE:

DELAY2SECONDS
FILEINFO
#PUSHVAR
#SETVAR"THISISANINFILE"
#OUTPUTVVAR
WHO
TIME
FUPINFO*
VOLUME

TheATattributeofthisjobspecifiesthatthejobistobeexecutedEXACTLYatthattime.
(youmaynotalwaysbeabletosettheATattributeofajob,duetorestrictionsplacedonthe
scheduler
byyoursystemadministrator.Similarly,theRUNNOWcommandmaytooberestricted)

JobControlCommands:
=====================
Youcanseethestatusofyoursubmittedjobsusing

STATUS<JOBNAME>or

STATUS*(forstatusofalljobs)

commandontheBatchcomprompt.

Itistobenotedherethatajob,ifnotarecursivejob(i.e.notwithEVERYattribute),
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

S-ar putea să vă placă și