ESASLRUJ EXEC
/*********************************************************/ /* (c) COPYRIGHT Velocity Software, Inc. 1996 */ /*********************************************************/ /* Update the JCL files (well, filetype $JCL, actually), replacing any existing ones. Log files (UPDATES, UPDLOG) are erased if all updates are successful. Syntax: ESASLRUJ ctl_fn ( NOERase where the default ctl_fn is ESASLR. If the NOERASE is specified, the xxx UPDATES and xxx UPDLOG files are not erased. */ Parse Arg ctl_fn rest '(' opt optrest If rest <> '' Then Call Msg 'Extra parm(s) <'rest'> ignored.' erase_flg = ^Abbrev('NOERASE',Translate(opt),4) If erase_flg & opt <> '' Then Call Msg 'Option <'opt'> ignored.' If optrest <> '' Then Call Msg 'Option(s) <'optrest'> ignored.' /* Find input files. Use ESASLREJ as a key, since we know it exists */ 'pipe command LISTFILE ESASLREJ $JCL * (NOH |', 'take 1 |', /* First disk only */ 'spec w3 1.1 |', /* The filemode (letter only) */ 'var mode' If ctl_fn = '' Then ctl_fn = 'ESASLR' ctl_fn = Translate(ctl_fn) Address Command 'ESTATE' ctl_fn 'CNTRL *' If Rc <> 0 Then Call Exit Rc,"File '"ctl_fn" CNTRL *' not found." 'pipe (end %)', 'COMMAND LISTFILE * $JCL' mode '|', /* Identify $JCL files */ 'stem files. |', /* Save the file ids */ 'spec /EXEC EXECUPDT/ 1', /* Build the EXECUPDT command */ 'w1 nw', '/JCL/ nw', '/'mode'/ nw', '/ (CTL' ctl_fn '/ nw |', 'cms' If Rc = 0 & erase_flg Then 'pipe', 'stem files. |', 'spec /ERASE/ 1', 'w1 nw', '/UPDATES/ nw', '/'mode'/ nw', 'write', '/ERASE/ 1', 'w1 nw', '/UPDLOG/ nw', '/'mode'/ nw |', 'command' Call Exit 0 Exit: Parse Arg xRc,xMsg If xMsg <> '' Then Call Msg xMsg Exit xRc Msg: Parse Arg mMsg Say mMsg Return 0