/*-- JOBHIST IOF Rexx Exec ------------------------------*/ /* Version 3. Use some new features of IOF 7D to */ /* separate jobs, and to enhance error messages. */ /* */ /* This exec must be invoked from the IOF Job Summary */ /* Panel. It snaps a copy of the job's system data */ /* sets to the user's JOBS.JOBHIST data set. */ /*--------------------------------------------------------*/ /*--------------------------------------------------------*/ /* Establish the IOF Rexx addressing environment. */ /*--------------------------------------------------------*/ address IOF /*--------------------------------------------------------*/ /* Verify that JOBHIST was invoked on the IOF Job */ /* Summary Panel by checking the HELP panel name. */ /* Use the TSIMSG command to give a SHORT and LONG */ /* error message if not on the correct panel. */ /*--------------------------------------------------------*/ "TSICOPY NAME(HELP) TO(REXX) SECTION(PANEL)" if help \= "JOBSUM" then do "TSIMSG 'Panel'", "'JOBHIST exec must be invoked on Job Summary Panel'" exit end /*--------------------------------------------------------*/ /* Define the job history data set name. This data */ /* set name will be prefixed with the user's current */ /* TSO prefix. If the caller supplied an argument to */ /* the exec, use it as the data set name. Otherwise */ /* use the default data set name. */ /*--------------------------------------------------------*/ parse arg HistDSN if HistDSN = '' then HistDSN = "JOBS.JOBHIST" /*--------------------------------------------------------*/ /* Determine if the history data set exists. If it */ /* does not exist, create it. Otherwise mod the new */ /* history to the existing data set. */ /*--------------------------------------------------------*/ if SYSDSN(HistDSN) \= "OK" then "SD DA("HistDSN") LRECL(133) RECFM(VBA) TRACKS(10,10)" else "SD DA("HistDSN") MOD" /*--------------------------------------------------------*/ /* Check the return code from the SD command. If non */ /* zero, quit with a WARNING message. The return code */ /* keys the message. */ /*--------------------------------------------------------*/ if rc \= 0 then do "WARNING" rc exit end /*--------------------------------------------------------*/ /* Get the jobname, jobid and time run of the current */ /* job. From the Job Summary Panel this information is */ /* in the JOBINFO section. The information is fetched */ /* into rexx variable names jobname, jobid and ran. */ /*--------------------------------------------------------*/ "TSICOPY NAME(JOBNAME JOBID RAN) TO(REXX) SECTION(JOBINFO)" /*--------------------------------------------------------*/ /* Skip to top-of-form. Add a line to the target data */ /* set listing the jobname, jobid and run timestamp. */ /*--------------------------------------------------------*/ "SNAPTEXT ASA(1) CHAR" jobname jobid "Run at" ran /*--------------------------------------------------------*/ /* Add a blank line to the target data set. */ /*--------------------------------------------------------*/ "SNAPTEXT CHAR " /*--------------------------------------------------------*/ /* Add the jobname and jobid to the target history data */ /* set in exploded block letters. */ /*--------------------------------------------------------*/ call "IOF$SH1" jobname jobid /*--------------------------------------------------------*/ /* Snap a copy of the job's log, jcl and messages */ /* files to the history data set. */ /*--------------------------------------------------------*/ "1-3 SNAP" /*--------------------------------------------------------*/ /* Save the SNAP return code for possible WARNING. */ /*--------------------------------------------------------*/ snaprc = rc /*--------------------------------------------------------*/ /* Close the history data set. */ /*--------------------------------------------------------*/ "SNAPCLOS" /*--------------------------------------------------------*/ /* Check SNAP return code. If non-zero, issue a */ /* WARNING message that describes the problem. */ /*--------------------------------------------------------*/ if snaprc \= 0 then "WARNING" snaprc