ESASLRB EXEC
/************************************************************/ /** (c) COPYRIGHT Velocity Software, Inc. 1993-1996 **/ /************************************************************/ /* */ /* ESAMAP/ESAMON SLR Interface */ /* */ /* Usage: ESASLR function operands [(] options [)] */ /* */ /* where function is the function to be performed, */ /* operands are the operands associated with the */ /* function, */ /* and options are options to control the process */ /* */ /************************************************************/ Parse Upper Arg function operands '(' options ')' . If function = '' Then Call Exit 24 'No function specified' i = WORDPOS('TEST', options) If i > 0 Then Do options = SUBWORD(options, 1, i-1) SUBWORD(options, i+1) netid = '*' End Else Do 'MAKEBUF' buffer = RC 'IDENTIFY ( LIFO' If RC = 0 Then Parse Pull . . . . netid . 'DROPBUF' buffer End options = STRIP(options) If options ^= '' & function = 'UPDATE' Then Call Exit 24 'Unrecognized option(s) "'options'"' options = 'S C D U' /* System, CPU, Device, User */ opts = '' types = '' fns = '' /* Determine database history files selected */ Do While options <> '' Parse Var options option options option = SUBSTR(option,1,1); Select When option = 'S' Then type = 1 When option = 'C' Then type = 2 When option = 'D' Then type = 3 When option = 'U' Then type = 4 Otherwise Call Exit 24 'Option "'option'" not recognized' End opts = opts option types = types WORD(type,'System CPU Device User') fns = fns WORD(type,'SYS CPU DEV USER') End Select When function = 'GENERATE' Then Do If operands <> '' Then Do Parse Var operands ftype . Address Command 'ESTATE ESA'||Word(fns,1) ftype '*' If Rc <> 0 Then Call Exit 8, 'No history file found with filetype' ftype End Do While opts <> '' Parse Var opts option opts Parse Var types type types Parse Var fns fn fns 'CALL BLDSEG ESA'||fn ftype 'CALL BLDUPDT ESA'||fn ftype Say 'SLR' type 'log table definition created.' End End When function = 'ASSEMBLE' Then Do Parse Var operands node . If node = '' Then node = 'MVS' Do While opts <> '' 'CP SPOOL PUNCH CONT TO' netid 'CP TAG DEV PUNCH' node 'JOB' Parse Var opts option opts Parse Var types type types 'CALL RUNASM' type 'CP SPOOL PUNCH NOCONT CLOSE' Say 'SLR' type 'table assembly job submitted.' End End When function = 'UPDATE' Then Do Parse Var operands node . If node = '' Then node = 'MVS' 'CP SPOOL PUNCH CONT TO' netid 'CP TAG DEV PUNCH' node 'JOB' Do While fns <> '' Parse Var fns fn fns 'CALL RUNUPDT' fn End 'CP SPOOL PUNCH NOCONT CLOSE' Say 'SLR table update job submitted.' End When function = 'COLLECT' Then Do Parse var operands node ftype . If node = '' Then node = 'MVS' If ftype = '' Then ftype = 'HISTORY' Do While opts <> '' 'CP SPOOL PUNCH CONT TO' netid 'CP TAG DEV PUNCH' node 'JOB' Parse Var opts option opts Parse Var types type types Parse Var fns fn fns 'CALL RUNCOLL ESA'fn ftype 'CP SPOOL PUNCH NOCONT CLOSE' Say 'SLR' type 'log collection job submitted.' End End Otherwise Call Exit 24 'Function "'function'" not recorgnized' End Call Exit 0 Exit: Parse Arg xRc xMsg If xMsg <>'' Then Say xMsg Exit xRc BLDSEG: Procedure; /* Build segment definitions from the specified history file */ Parse Arg histfn histft . 'pipe <' histfn histft , '| ESASLRB seggen' histfn histft Return; BLDUPDT: Procedure; /* Build SLR table update command streams from specified history file */ Parse Arg histfn histft . 'pipe <' histfn histft , '| ESASLRB segupdt' histfn histft Return; RUNASM: Procedure; /* Build jobs to assemble table definitions */ Parse Upper Arg type . If type = 'USER' Then type = 'USR' 'pipe', '< segment list |', 'locate /*/ |', /* Only selected segments */ 'locate 10-12 /'type'/ |', /* from the named file */ 'spec \(stagesep !) < ESASLRJ'Left(type,1) 'JCL !\ 1', '\append < ESASLRPA JCL !\ nw', '\append literal //L EXEC GASM,M=\ nw 1-6 next \L!\ next', '\append < ESASLRSI JCL !\ nw', '\append <\ nw 1-6 nw \l ASSEMBLE !\ next', '\append < ESASLREJ JCL !\ nw', '\append literal //S EXEC GASM,M=\ nw 1-6 next \S!\ next', '\append < ESASLRSI JCL !\ nw', '\append <\ nw 1-6 nw \s ASSEMBLE !\ next', '\append < ESASLREJ JCL !\ nw', '\punch 00D !\ nw', '\take 0 ! cp close 00D\ nw |', 'runpipe |', 'console' 'CP CLOSE 00D' Return; RUNUPDT: Procedure; /* Build jobs to assemble table definitions */ Parse Upper Arg type . If type = 'USER' Then type = 'USR' 'pipe', '< segment list |', 'locate /*/ |', /* Only selected segments */ 'locate 10-12 /'type'/ |', /* from the named file */ 'spec \(stagesep !) < ESASLRJ'Left(type,1) 'JCL !\ 1', '\append < ESASLRPS JCL !\ nw', '\append <\ nw 1-6 nw \ TBLUPDT !\ next', '\append < ESASLREJ JCL !\ nw', '\punch 00D !\ nw', '\take 0 ! cms sp pun close\ nw |', 'runpipe |', 'console' 'CP CLOSE 00D' Return; RUNCOLL: Procedure; /* Build jobs to assemble table definitions */ Parse Upper Arg histfn histft . type = Substr(histfn,4) If type = 'USER' Then type = 'USR' 'pipe <' histfn histft '| ESASLRB segcoll' histfn histft 'pipe', '< segment list |', 'locate /*/ |', /* Only selected segments */ 'locate 10-12 /'type'/ |', /* from the named file */ 'ESASLRB runcoll' histfn histft '|', 'cp close 00D' Return;