Difference between revisions of "WRKACTJOB a resource hog"
Line 38: | Line 38: | ||
Answer courtesy Ed Fishel via Midrange-L | Answer courtesy Ed Fishel via Midrange-L | ||
+ | |||
+ | See [[WHO BAD]] for a [[CLP]] program using WRKACTJOB. |
Latest revision as of 03:16, 29 May 2005
Over the years there have been changes to the way WRKACTJOB works. What was once true for DSPACTJOB on System/38 is no longer true for WRKACTJOB. Unfortunately people still pass on the old recommendations. In the following paragraphs I will attempt to provide an up to date description of WRKACTJOB.
When you exit WRKACTJOB by using Enter, F3, or F12 you have totally ended WRKACTJOB. The statistics reported by WRKACTJOB are not collected by WRKACTJOB. The collection of those statistics is always done for every job in the system by LIC. This collection occurs even when WRKACTJOB has never been used on the system.
WRKACTJOB does keep an internal space somewhere to save the current statistics so that it can report the changes the next time it is used within the same job. You can reset those statistics by using F13=Reset statistics or by using the RESET(*YES) parameter on the command. Using System Request followed by option 2 will cause WRKACTJOB to destroy the internal space it uses to save its statistics. It will then create another space the next time it is run. The space is also destroyed at the end of the job, so there is no advantage to using System Request followed by option 2 to end WRKACTJOB. The only WRKACTJOB resource you release when you sign off is the internal space object used to store the statistics. The size of this space varies based on the number of active jobs in the system. By signing off and then on again after each use of WRKACTJOB you are forcing it to recreate that space in the new job. This will waste more resources than it saves. Since WRKUSRJOB does not report any job statistics it does not need to use a space to save them.
In the past, the reason for the recommendation to not use WRKACTJOB (or DSPACTJOB on System/38) was because of the resources that it used while it was building the data to be displayed. In the past WRKACTJOB searched all work control blocks on the system looking for active jobs. When the system had lots of jobs with a status of JOBQ or OUTQ it could take WRKACTJOB a relatively long time to find just the active jobs. This was changed several releases ago. Now WRKACTJOB uses a much faster LIC interface to materialize the list of active jobs.
Answer courtesy Ed Fishel via Midrange-L