/* Rexx *************************************************************/ /* */ /* NAME: R E X X C M D 1 */ /* */ /* LOCATION: RKAUUSER (REXXCMD1) . */ /* */ /* TYPE: Rexx Exec. */ /* */ /* INVOKED BY: */ /* */ /* INVOCATION: EXEC REXXCMD1 */ /* */ /* PURPOSE: This Rexx Exec is invoked by an authorized user */ /* issue a MVS Command and take a look at the */ /* Output. */ /* */ /* */ /* PARAMETERS: N/A */ /* */ /* OUTPUT: SAY statements will write to AF/Operator log. */ /* */ /* */ /* MESSAGES: ----- */ /* */ /* EXTERNAL VARS: */ /* */ /* TRAPS: None. */ /* */ /* TABLES: None. */ /* */ /* */ /* INTERNAL RTNS: N/A */ /* */ /* EXTERNAL RTNS: N/A */ /* */ /* FILES USED: None. */ /* */ /* ENVIRONMENT: This Rexx Exec executes entirely within the */ /* AF/Operator address space under MVS/OS390/zOS. */ /* */ /* DEPENDENCIES: AF/Operator must be up and running. */ /* */ /* RELATIONS: */ /* */ /* OPERATION: 01) Check if Saturday and greater than 19:00 */ /* exit program if it is. */ /* 02) Check if Sunday and less than or equal to */ /* 5:00 exit program if it is */ /* 03) Check if JES is active. */ /* 04) Issue command. */ /* 05) Look through the output of the command. */ /* */ /* AUTHOR: Edward Schmoeller */ /* */ /* CREATED: August, 13, 2010 */ /* */ /* ------------------------------------------------------------------ */ /* */ /* CHANGE LOG: Sequence from latest to earliest (Descending). */ /* */ /* DATE CHANGED BY DESCRIPTION OF CHANGE CHG# */ /* -------- ---------- ----------------------------------- ---- */ /* mm/dd/yy Who dun it Why did you make this change? @001 */ /* */ /**********************************************************************/ /* ------------------------------------------------------------------ */ /* Housekeeping and initialization. */ /* ------------------------------------------------------------------ */ PARSE SOURCE . . execname . /* Get environment info. */ myrc = 'SYSVGET'("test") /* Get trace indicator. */ IF WORDPOS(execname,test) > 0 THEN TRACE r /* Trace or not to trace. */ /* ------------------------------------------------------------------ */ if date('W') = 'Saturday' & time('H') > 19 then exit if date('W') = 'Sunday' & time('H') <= 5 then exit myrc = REDIRECT("disp.","*") myrc = active('JES2') if myrc = 0 then exit /* JES2 is not online */ /* exit process. */ "OPER 'D A,JES2' RESP" do i = 1 to disp.0 /* look through the output */ if wordpos('JES2',disp.i), /* of the Command and find */ & pos('A=',disp.i) > 0 then do /* JES2 and A=. If found */ say '***' execname 'found' disp.i /* then process. */ exit end end say '***' execname 'did not find JES2 and A=.'