12.07.2015 Views

SOE in Action Examples of SOEEXEC usage - Nordic TWS conference

SOE in Action Examples of SOEEXEC usage - Nordic TWS conference

SOE in Action Examples of SOEEXEC usage - Nordic TWS conference

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IBM Tivoli Workload Scheduler for z/OS<strong>SOE</strong> <strong>in</strong> <strong>Action</strong><strong>Examples</strong> <strong>of</strong> <strong>SOE</strong>EXEC <strong>usage</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSWhat is an <strong>SOE</strong>EXEC? A REXX program that calls <strong>SOE</strong> Any process you can do through the dialogs can be performed Some processes you can't are possible as well <strong>SOE</strong> will be extended by <strong>SOE</strong>EXECs written by IBM You can add to this yourself<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSBuild<strong>in</strong>g an Application from a CSV file <strong>SOE</strong>EXEC CSVBUILD creates a primitive application(s) Fields are mapped from the CSV file to YOUR specification Operations will be numbered to your policy Multiple applications will be created if too many operations created Fields can be defaulted Lookup lists can translate fields<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAn example <strong>of</strong> CSVBUILD//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=CSVBUILD//INPUTDEF DD *MAP(JOBN,HIGHRC,PRED,FORM,.,WSID)ADID(FRED) FORM(DD0001)WSID(CPU1) UPDATE(N)//CSVFILE DD *JOBAJOBB,4,JOBA,DD0002,HELLO,CPU2JOBC,,JOBA JOBQ,,GOODBYEJOBD,,JOBB JOBCJOBQJOBAJOBBJOBDJOBQJOBC<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSCSVBUILD considerations This creates primitive applications Run cycles, resources etc can be entered through the dialogs External dependencies need to be clarified CSVBUILD does the majority <strong>of</strong> the work for you<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSF<strong>in</strong>d what Applications a job is <strong>in</strong> Give <strong>SOE</strong>XEC JOBFIND a jobname and it will tell you– Application ID– Valid From Date– Status– Workstation– Jobname (s<strong>in</strong>ce you can use wildcards)– Operation number– Next used Operation Number– Next unused Operation number The output can be sent to a file or another <strong>SOE</strong>EXEC (via Stack) You can search for whole lists <strong>of</strong> jobs at once<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAn example <strong>of</strong> JOBFIND//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=JOBFIND,// ARGS='@JOBN(ZAPPED) INFILE(MOREJOBS) DATA(ODD)'//ODD DD SYSOUT=*//MOREJOBS DD *FRED*<strong>TWS</strong>C*<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSSample JOBFIND outputADID FROM S WSID JOB OP NXT AVL TAG---------------- ------ - ---- -------- --- --- --- ---BATLOADC 080530 P DUMM ZAPPED 010 000 011 ZAPPED+*BATLOADNONE 080608 A DUMM ZAPPED 254 255 000 ZAPPED+*BATLOAD2 080501 A DUMM ZAPPED 010 020 011 ZAPPED+*BATLOAD2 080901 A DUMM ZAPPED 010 011 012 ZAPPED+*BATLOAD2 081001 A DUMM ZAPPED 010 020 011 ZAPPED+*BATLOAD3 081105 P DUMM ZAPPED 010 020 011 ZAPPED+*BATLOAD3 081125 P DUMM ZAPPED 010 020 011 ZAPPED+*BATLOAD3 081130 P DUMM ZAPPED 010 020 011 ZAPPED+*BATLOAD4 081130 A DUMM ZAPPED 010 000 011 ZAPPED+*BATLOAD5 080219 A DUMM ZAPPED 010 000 011 ZAPPED+*BATLOAD6 080530 A DUMM ZAPPED 010 000 011 ZAPPED+*BATLOAD6COPY 080530 P DUMM ZAPPED 010 000 011 ZAPPED+*DISCONTEST 070828 A CPU1 <strong>TWS</strong>CDUM1 010 020 011 <strong>TWS</strong>C*+*DISCONTEST 070828 A CPU1 <strong>TWS</strong>CDUM2 020 030 021 <strong>TWS</strong>C*+*DISCONTEST 070828 A CPU1 <strong>TWS</strong>CDUM3 030 040 031 <strong>TWS</strong>C*+*DISCONTEST 070828 A CPU1 <strong>TWS</strong>CDUM4 040 050 041 <strong>TWS</strong>C*+*DISCONTEST 070828 A CPU1 <strong>TWS</strong>CDUM5 050 000 051 <strong>TWS</strong>C*+*<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSUpdat<strong>in</strong>g operations <strong>SOE</strong>EXEC JOBUPD allows operations to be updated You specify the job name and the attributes to update JOBUPD then calls JOBFIND to f<strong>in</strong>d the jobs It then generates Batch Loader (database update language) You can review or execute the Batch Loader Input can be ONE job, or a CSV file<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSA simple example <strong>of</strong> JOBUPD//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=JOBUPD,// ARGS='@JOBN(MYJOB) HIGHRC(4)'//OUTBL DD SYSOUT=* This example f<strong>in</strong>ds every occurrence <strong>of</strong> MYJOB <strong>in</strong> the database andchanges the highest return code to 4<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSA simple CSV example <strong>of</strong> JOBUPD//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=JOBUPD,// ARGS='MAP(@JOBN,HIGHRC,DESCR)'//OUTBL DD SYSOUT=//CSVFILE DD *MYJOB,4,This is my jobOTHERJOB,,This is not my job This example f<strong>in</strong>ds every occurrence <strong>of</strong> MYJOB <strong>in</strong> the database andchanges the highest return code to 4 and sets the description, then justchanges the description for OTHERJOB<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAdd<strong>in</strong>g special resources//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=JOBUPD,// ARGS='MAP(2) SKIP(2)'//OUTBL DD SYSOUT=//CSVFILE DD *,,,,<strong>TWS</strong> Change Input@JOBN,UPDSR,QUANTITY,USAGE,ONCOMPLETE,KEEPONERRMYJOB,MY#RESOURCE,1,S,,OTHERJOB,MY#OTHER#RESOURCE,1,X,N,K This example shows the addition <strong>of</strong> special resources to an operation.<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSRemov<strong>in</strong>g special resources//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=JOBUPD,// ARGS='MAP(2) SKIP(2)'//OUTBL DD SYSOUT=//CSVFILE DD *,,,,<strong>TWS</strong> Change Input@JOBN,DELSRMYJOB,MY#RESOURCEOTHERJOB,MY#OTHER#RESOURCE And <strong>of</strong> course they can be deleted just as easy.<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAnd wouldn't it be nice if?...//RUNPIF EXEC EQQYXJCL,// SUBSYS=<strong>TWS</strong>C,// CMD=JOBUPD,// ARGS='MAP(1) UPDATE(Y) SKIP(1) OPMODE(INSERT)'//OUTBL DD SYSOUT=*//CSVFILE DD *@JOBN,@WSID,WSID,DLTIME,DURATION,DESCRARMJ01U8,CPU1,SLAT,1730,1,SLA OperationGTMDA9ED,CPU1,SLAT,1130,1,SLA OperationGTMD90BA,CPU1,SLAT,0800,1,SLA Operation<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAnd don't forget… No updates are made unless you code UPDATE(Y). UPDATE(N) displays the Batch Loader it would have used.<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSDynamic Insertion - SUBLINK SUBLINK is given 3 classes <strong>of</strong> arguments –1. The Application you want to <strong>in</strong>sert <strong>in</strong> the current plan2. Arguments to identify an <strong>in</strong>dividual job you might want to l<strong>in</strong>k it to3. Arguments to def<strong>in</strong>e how to l<strong>in</strong>k them SUBLINK will then –– F<strong>in</strong>d the ADID, IA and OPNO to l<strong>in</strong>k to (if requested)– Look up all the successors to that operation (<strong>in</strong>ternal and external)– Insert the new application as a successor (if requested)– Make all the successors to the <strong>in</strong>sertion po<strong>in</strong>t a successor to the new application(aga<strong>in</strong> if that is what you want)– SUBLINK can even ONLY submit the new application if the Operation is wait<strong>in</strong>g <strong>in</strong>the plan<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAssumptions and consequences Assumes the FIRST operation is 001 and LAST is 255 You can override this The FIRST operation will be dependent on the <strong>in</strong>sertion po<strong>in</strong>t The LAST operation will receive the successors You tie whatever you want <strong>in</strong>ternally to FIRST and LAST If the <strong>in</strong>sertion po<strong>in</strong>t is not WAITING then an error will be reported ifit was required The new Application <strong>in</strong>herits all the dependencies <strong>of</strong> the <strong>in</strong>sert po<strong>in</strong>t Any successors to the <strong>in</strong>sert po<strong>in</strong>t will wait for the new application<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSFIXED1DYNAM1001 FIRST010 DYN1255 LASTDYNAM2001 FIRST010 DYN2255 LASTFIXED2FIXED3<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSA SUBLINK example//RUNPIF EXEC EQQYXJCL,// SUBSYS=CWSC,// CMD=SUBLINK//CMDIN DD *SUBMIT(ADHOC1) ALIAS(NEWNAME)@JOBN(<strong>TWS</strong>CCPEX) REQD(CONDITIONAL)LAST(005)<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSWhat else can be done? These are typical examples <strong>of</strong> what can be done Anyth<strong>in</strong>g that you can do through the dialogs you can do through <strong>SOE</strong> The sort <strong>of</strong> th<strong>in</strong>gs we might do…– F<strong>in</strong>d predecessors and successors, even external ones– F<strong>in</strong>d Special Resources anywhere <strong>in</strong> the database– NOP jobs <strong>in</strong> the Current Plan<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSHow do you design an <strong>SOE</strong>EXEC Start with the process you want to do – e.g. NOP operations Determ<strong>in</strong>e what your <strong>in</strong>puts need to be Match them up with <strong>SOE</strong> and <strong>TWS</strong> requirements Determ<strong>in</strong>e how to lookup any mismatch Write and <strong>SOE</strong>XEC to– Generate the <strong>SOE</strong> commands– CALL <strong>SOE</strong>– Process the feedback<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAn example <strong>of</strong> design To NOP a set <strong>of</strong> jobs <strong>in</strong> the Current Plan Your <strong>in</strong>put may be a list <strong>of</strong> jobs The <strong>SOE</strong> commands to NOP one would look like this –MODIFY CPOC ADID(MYAPPL) IA(080612)MODIFY CPOP OPNO(10) OPCMD(NP) You must f<strong>in</strong>d each operation <strong>in</strong> the Current Plan Each operation must be an appropriate status or <strong>in</strong>put arrival Generate the MODIFY commands.<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAnatomy <strong>of</strong> an <strong>SOE</strong>EXECCommands arepassed to <strong>SOE</strong>Asterisk <strong>in</strong> aby queu<strong>in</strong>g them /*----------------------------------------------------------+DATA argumenton the stack| Initialise variables says | pass the+----------------------------------------------------------*/ data back on thePARSE ARG argSUBSYS argJOB argSTATUSstack/*----------------------------------------------------------+| Setup the <strong>SOE</strong> command |+----------------------------------------------------------*/QUEUE "OUTPUT CPOP=* DATA(*)" ,"FIELDS(CPOPADI=*,CPOPIA=*,CPOPNO=*,CPOPJBN=*)"QUEUE "LIST CPOPCOM JOBNAME("||argJOB||")" ,"STATUS("||argSTATUS||")"/*----------------------------------------------------------+Fields are split | Run the <strong>SOE</strong> command |by "00"x +----------------------------------------------------------*/pifRC = EQQYXTOP(argSUBSYS)IF pifRC 0 THENEXIT pifRCReadthewholestack/*----------------------------------------------------------+| Grab the output |+----------------------------------------------------------*/@ = "00"xDO WHILE QUEUED() 0PARSE PULL <strong>in</strong>ADID (@) <strong>in</strong>IA (@) <strong>in</strong>OPNO (@) <strong>in</strong>JOB (@)SAY ">>" <strong>in</strong>ADID <strong>in</strong>IA <strong>in</strong>OPNO <strong>in</strong>JOBEND<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>The firstargument mustalways be <strong>TWS</strong>subsystemDo someth<strong>in</strong>gwith itAfter that youcan passwhatever youneed=* <strong>in</strong> a fielddef<strong>in</strong>ition meansdrop the labelYou can buildyour commandsus<strong>in</strong>g variablesThis calls <strong>SOE</strong>,passes theSUBSYS andprocesses thestackWe get thereturn code backPARSE out thedata© 2008 IBM Corporation


IBM Tivoli Workload Scheduler for z/OSAny questions?<strong>SOE</strong> <strong>in</strong> <strong>Action</strong>© 2008 IBM Corporation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!